Last active
October 7, 2021 14:06
-
-
Save itsHall/43c989781fa74e45538afd05a3449b44 to your computer and use it in GitHub Desktop.
Removes noreferrer from href="_blank" links | WP
This file contains 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
<?php | |
//---------------------------------------------------// | |
// Removes noreferrer from your new or updated posts // | |
//---------------------------------------------------// | |
add_filter( 'wp_targeted_link_rel', 'my_targeted_link_rel_remove_noreferrer',999); | |
function my_targeted_link_rel_remove_noreferrer( $rel_values ) { | |
return preg_replace( '/noreferrer\s*/i', '', $rel_values ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment