How to Disable/remove rel=”noopener noreferrer” from WordPress?

Last updated on
by Saurabh K

Have you noticed rel=”noopener noreferrer” tags along with target=”_blank” in WordPress? Are you having issues with affiliate due to links with rel=”noopener noreferrer”? Do you want to disable or remove it completely? Here is a guide to completely remove rel=”noopener noreferrer” from WordPress.

In April 2017, WordPress came up with an update to add rel=”noopener noreferrer” along with the target=”_blank” Tag.

What is rel=”noopener noreferrer”?

rel=”noopener noreferrer” tags are being added when you set target=”_blank” for external or internal links to be opened in a new tab of the browser.

Get WP Rocket WordPress Cache Plugin.

This is something a very important ingredient in the WordPress update 4.7.4 to prevent Reverse Tabnabbing.

Tabnabbing [1] is a kind of a Phishing attack where the attacker replaces the legitimate and trusted page tab with a malicious document by using window.opener.location.assign().

  • When you add noopener keyword, the new/another page cannot access your Window object via window.opener.
  • The noreferrer keyword tells the browser, not to collect HTTP referrer information when the link is followed.

Does rel=”noopener noreferrer” Tag Is Harmful For Affiliate Marketers?

There are few forums, where members are discussing – link with rel=”noopener noreferrer” tags are not getting paid affiliate commissions.

Partially this is true. It seems like affiliates did not adopt the new functionality in their systems yet.

rel=noreferrer indicates not to pass any referral information to the attached link.

Using this tag in a clicked link will not pass HTTP header referrer information. It means affiliate server will not get information like browser, region, os, device and few more if someone clicks on affiliate link with rel=noreferrer tag.

Further, you may notice that few of the affiliate owners may not pay a commission if they don’t know the actual source of the affiliate sale. And as a result, they may reject to pay you.

Therefore, the only way is removing rel=”noopener noreferrer” from WordPress.

Step by Step Guide to Remove rel=”noopener noreferrer” from WordPress

Here is a simple method to avoid adding rel=”noopener noreferrer” for hyperlinks with target=”_blank”. You just need to add the below code into WordPress Theme’s function.php file.

Note: Take a backup of the theme’s function.php file before you make any changes to it.

// Note that this code intentionally disables a TinyMCE security feature.
add_filter('tiny_mce_before_init','tinymce_allow_unsafe_link_target');
function tinymce_allow_unsafe_link_target( $mceInit ) {
$mceInit['allow_unsafe_link_target']=true;
return $mceInit;
}

Now, no rel=”noopener noreferrer” tag will be added to your links when you set hyperlinks to open in a new tab?

But what about existing links? Do you need to remove the code from each and every post manually due to this issue?

I guess, there is no need to do it manually. There is one trick to get it done in 10-15 minutes.

How To Remove rel=”noopener noreferrer” From Existing WordPress Pages/Posts?

To delete/remove rel=”noopener noreferrer” from existing WordPress posts, you will require taking the help of one WordPress Plugin Better Search Replace. The following are the steps to remove rel=”noopener noreferrer” from DoFollow links and similarly from NoFollow links.

Better Search Replace Wordpress Plugin
Better Search Replace Wordpress Plugin

Search and Replace rel=”noopener noreferrer” from DoFollow links in WordPress 

  • First of all, install and active Better Search Replace WordPress Plugin.
  • Next, Go to the Tools → Better Search Replace.
  • Further, navigate for the Search/Replace Tab,
  • In Search for box, enter rel=”noopener noreferrer”.
  • Keep the Replace box with a blank.
  • Now, select the Table/s where you need to remove rel tags.
  • Uncheck the box Run as a dry run.
  • Finally, Hit the Run Search/Replace button.

Search and Replace rel=”noopener noreferrer” from NoFollow links in WordPress

  • First of all, install and active Better Search Replace WordPress Plugin.
  • Next, Go to the Tools → Better Search Replace.
  • Further, navigate for the Search/Replace Tab,
  • In Search for box, enter rel=”nofollow noopener noreferrer”.
  • Keep the Replace box with a blank.
  • Now, select the Table/s where you need to remove rel tags.
  • Uncheck the box Run as a dry run.
  • Finally, Hit the Run Search/Replace button.

Summary

WordPress has added rel=”noopener noreferrer” to prevent from Reverse Tabnabbing. However, a few affiliate marketers noticed that affiliate links with rel=noreferrer are not generating affiliate commissions.

So, removing rel=”noopener noreferrer” from WordPress can be the better solution until the affiliates start accepting links with rel=”noopener noreferrer” tags.

I hope you have followed the complete process and removed rel=”noopener noreferrer” from your WordPress website/blog.

However, if you find any difficulty to implement a similar process, do let me know in the comments section below, I would be happy to help.

More to read —

I write actionable content and share proven methods to make money online from blogging. Drop me a line on Twitter, subscribe to my newsletter or buy me a coffee.

Trending Right Now!

Disclaimer: Some of the links on this blog are affiliate links. If you click through and purchase any product, we may earn a commission at no additional cost to you.

Leave a Comment