Disable WP noopener

Post date: 02-May-2018 20:10:43

Probably no longer works because of new WP editor. Leaving here for ref just in case it is useful elsewhere.

Disable rel=”noopener noreferrer” for links set to open in a new tab. Add to functions.php:

add_filter('tiny_mce_before_init','tinymce_allow_unsafe_link_target'); function tinymce_allow_unsafe_link_target( $mceInit ) {  $mceInit['allow_unsafe_link_target']=true;  return $mceInit; }

Because it is only really for user added links, but WP have added it to every link, anywhere on the site. Strange - it does seem to only remove noopener and leave noreferer... great!)

Note: This will cease to work when TinyMCE gets replaced, But that's a way off.