There are several ways to remove the rel="noreferrer"
attribute from links in WordPress.
Using a plugin
Install a plugin that allows you to remove rel="noreferrer"
from links. Popular options include:
- WP External Links: https://wordpress.org/plugins/wp-external-links/
- AIO SEO: https://wordpress.org/plugins/all-in-one-seo-pack/ (This plugin has the option to remove
rel="noreferrer"
as part of its functionality.)
Once installed, activate the plugin and follow its configuration instructions to remove rel="noreferrer"
. Plugins usually offer a user-friendly interface to manage link attributes.
Using functions.php or inserting via Code Snippet plugin
Add this code to functions.php file of your theme to remove rel=”noreferrer” from outgoing links in WordPress. Or you can add it using a plugin like Code Snippet.
//remove noreferrer on the frontend, but will still show in the editor
function im_formatter($content) {
$replace = array(" noreferrer" => "" ,"noreferrer " => "");
$new_content = strtr($content, $replace);
return $new_content;
}
add_filter('the_content', 'im_formatter', 999);