Archived topic
rel=noreferrer
8 replies · Started by Philippe on March 3, 2022
Hi,
What is the best way to get rid of the "noreferrer" tag in all my posts? Is it enough to delete it in the HTML? (I read conflicting opinions about whether it works or not)
Thank you
Hi there,
WP provides this filter:
https://developer.wordpress.org/reference/functions/wp_targeted_link_rel/
So adding this PHP Snippet to your site should still work to remove all rel=norefferer attributes:
function my_links_control( $rel, $link ) {
return false;
}
add_filter( 'wp_targeted_link_rel', 'my_links_control', 10, 2 );
Adding PHP: https://docs.generatepress.com/article/adding-php/
No luck.
I used the Snippets plugin, waited a minute or so, went to a private page on Firefox, and clicked on Inspect. The noreferrer attribute is still present everywhere in posts and pages.
Can you share a link to a page where i can see them ?
Hmmm... looks like an issue with Gutenberg and that filter:
https://github.com/WordPress/gutenberg/issues/26914
If you scroll down on that feed you will see another users reply:
https://github.com/WordPress/gutenberg/issues/26914#issuecomment-949431820
That includes a PHP Snippet to filter out the_content to strip out the norefferer attribute.
That 'should' work....
All good. I'll check the website in more details later on but it seems to work.
Someone should think about giving you a medal. :)
I close this thread for now.
Glad to be of help !