If you’ve checked out the special code of your WordPress website, you might have seen something like “rel=’noopener'” on certain links. In this guide, we’ll explain what “rel=’noopener'” means, why WordPress puts it there, and how you can take it out if you want to.
What is rel=”noopener” in WordPress?
In 2017, WordPress began including the “rel=’noopener'” thing in links that have a “target=’_blank'” part.
No matter if you’re using the newer Gutenberg editor or the older Classic Editor, WordPress will automatically put this thing in links that are set to “Open in new tab.”
They did this to stop something called “tabnabbing.” This is a tricky way attackers can replace the page you’re looking at with a new one using a sneaky trick in the code.
Imagine you click a link, and the new page makes your old page look different. This is dangerous because you trust pages you already have open. Bad people can even make a fake page that looks like your site and asks for your login, but they steal your info.
When WordPress adds “rel=’noopener'” to links, it keeps other sites from messing with yours like this, which makes things safer.
Does rel=”noopener” Affects your WordPress SEO?
Because there are lots of different values for the “rel” thing, people new to SEO might worry that “rel=’noopener'” messes up their site’s SEO.
But having “rel=’noopener'” on your site’s links won’t mess up SEO.
Actually, it’s smart to keep “rel=’noopener'” on your links that open in new tabs for extra safety. The great part is, WordPress already does this for you, so you don’t have to do anything.
noopener vs nofollow
You might notice “noopener” and “nofollow” near links quite a bit. Let me explain the difference between them.
“Noopener” stops bad folks from hacking across different sites. This makes your site safer.
On the other hand, “nofollow” makes search engines ignore the link on your site. This means no “SEO value” goes to the site you’re linking to.
How to Disable rel=”noopener” in WordPress (Plugin)
If you don’t want “rel=’noopener'” to be put on your links in WordPress (which isn’t suggested), keep reading.
The simplest method to stop “rel=’noopener'” from showing up on your WordPress links is by using a plugin called “Remove noreferrer.”
Using the plugin is really easy – just install it and turn it on.
How to Disable rel=”noopener” in WordPress (Code Snippet)
If you know how to add bits of code to your WordPress site, either by using a file named functions.php or the Code Snippets plugin, you can use the following piece of code.
This code will only work if you’re using the Classic Editor. It stops WordPress from adding the “rel=’noopener'” thing to your links when you make them open in new tabs.
<?php //Removes rel="noopener" from automatically being added to links in WordPress add_filter( 'tiny_mce_before_init', 'da_allow_unsafe_link_target' ); function da_allow_unsafe_link_target( $mceInit ) { $mceInit['allow_unsafe_link_target'] = true; return $mceInit; }
This trick won’t make older posts change, so you can try a plugin called Better Search Replace to fix links in the old stuff.
Related Articles
Leave a Reply