Created
March 7, 2019 16:38
-
-
Save Log1x/972ec0a4a079ff6b5b5d746b172b5385 to your computer and use it in GitHub Desktop.
Remove noopener & noreferrer on WordPress links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove rel="noopener noreferrer" in TinyMCE links | |
* | |
* @param array $init | |
* @return array | |
*/ | |
add_filter('tiny_mce_before_init', function ($init) { | |
$init['allow_unsafe_link_target'] = true; | |
return $init; | |
}); | |
/** | |
* Prevent rel="noopener noreferrer" from automatically being added on post save. | |
* | |
* @return void | |
*/ | |
add_filter('wp_targeted_link_rel', function () { | |
return; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment