On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi everyone, I have an issue with a little plugin in version 2.7.1. In 2.6.5 it works, in 2.7.1 it does nothing.

    I wish to replace all target="_blank" in external links to rel="external nofollow noopener noreferrer". For this I have this little plugin:
    $out = &$modx->resource->_output;
    $search = array('target="_blank"');
    $replace = array('rel="external nofollow noopener noreferrer"');
    $out = str_replace($search,$replace,$out);

    It works on OnWebPagePrerender (which means it should work but does nothing).
    Any ideas or tips? Thanks for help.