We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54967
    • 1 Posts
    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.