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

Have you noticed rel=”noopener noreferrer” tags along with target=”_blank” in WordPress? Are you not receiving/getting affiliate commissions links with rel="noopener noreferrer"? Do you want to disable or remove it completely? Here is a guide to 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.

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

Tabnabbing 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.
  • Firefox does not support noopener, so you have to use rel=”noopener noreferrer”.

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.

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. 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.

The only way is removing rel=”noopener noreferrer” from WordPress.

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

how 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 below code into WordPress Theme’s function.php file.

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

// Note that this intentionally disables a tinyMCE security feature.

// Use of this code is NOT recommended.

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 any rel=”noopener noreferrer” tag will be added while you set hyperlinks to open in new tab?

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

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 help of one WordPress Plugin Better Search Replace.

Search-Replace DoFollow links:

Step #1: Install and Active Better Search Replace WordPress Plugin.

Step #2: Search for rel=”noopener noreferrer”

Step #3: Keep Replace with a blank.

Step #4: Select Table.

Step #5: Uncheck the box Run as a dry run.

Step #6: Hit the Run Search/Replace Button.

remove rel noreferrer from wordpress

Search-Replace NoFollow link:

Step #1: Install and Active Better Search Replace WordPress Plugin.

Step #2: Search for rel=”nofollow noopener noreferrer”

Step #3: Keep Replace with a blank.

Step #4: Select Table.

Step #5: Uncheck the box Run as a dry run.

Step #6: Hit the Run Search/Replace Button.

Summery:
WordPress has added rel=”noopener noreferrer” to prevent from Reverse Tabnabbing. However, few of 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.

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

Any Questions?
Comment them below, I will answer them soon.

  • Does rel=”noopener noreferrer” affect seo. I mean all my internal links are rel=”noopener noreferrer” so will they be still counted as dofollow or not by google?

    • Akshat,

      As I mentioned in the post that rel=noreferrer indicates not to pass any referral information to the attached link. This means it has nothing to do with do-follow or no-follow link attributes. If you add “nofollow” in rel tag than only Google and other search engines will count that link as no-follow else, it will do-follow by default.

      • Thanks for the clarification. Really appreciate it.

  • Yees…..”Better Search Replace has worked very well – all links have gone back to nor https://uploads.disquscdn.com/images/ec73934f96787855a201d2c6aef9b2a3174cd97e216a371e3cb97cea0e6a3d8f.jpg mal with a rel – nofollow. However I made a small change. Instead of putting rel=”nofollow noopener noreferrer” in the ”Search for” I put noopener noreferrer and did the rest as you used. It worked perfectly. I have attached my screen shoot. Now let me also implement the same thing in my other website I’m sure my affiliate earnings will go back to normal. I have to forward this link to my friends.

    • That’s great. Glad to know that it worked for you and you removed rel=noreferrer from your websites.

  • Hello Nikhil – I have implemented the code in my Functions Php on cruckers and it works very well for new posts. My next challenge is to remove the noreferrer in old post. Let me also run the plugin and follow instructions. Hope I don’t mess up things.