How To Stop WordPress From Adding Noreferrer + Its Importance

This post contains affiliate links. Which means I will make a commission at no extra cost to you should you click through and make a purchase. Read the full disclosure here.

Female WordPress Blogger Using Mini Computer Keyboard With Lots Of Typography A White Mug Of Coffee And Some Yellow Flowers

Ever looked at the code for your WordPress links and wondered what noreferrer means?

Well, if affiliate marketing. Or being able to accurately track your blog traffic using Google analytics. Is something that’s important to you.

Then you’ll want to keep reading to find out exactly what this code snippet does. Why you’ll likely want to remove it. And how to stop WordPress from adding noreferrer in your WordPress links code and blog posts.

Overall, issues related to rel=noreferrer. Have been coming and going through different WordPress versions. This issue was first seen in version 4.7.4 and then disappeared in 4.9 for a while. Until it seems to have recently reappeared in WordPress 5.0 and beyond.

So, where does noreferrer and other tags like it come from?

Well, when you add links to your WordPress posts and pages. The visual editor. Regardless of whether you use the Classic or Gutenberg block editor. Will often add HTML code to your links in the background for you automatically.

This is usually all well and good. After all, you are probably using the visual editor to save time and not have to worry about HTML code, right?

If you’ve never switched to view the HTML code of your blog post. Then you probably won’t have noticed WordPress adding tags. Like noreferrer or noopener to your WordPress links.

At the very least every blogger needs to know about nofollow links. As they are required for things like affiliate links. And are something you should consider for SEO purposes.

So, to help you understand the problems that noreferrer might cause for bloggers. Let’s cover what the different tags mean for your links in WordPress.

Keep in mind: That the nofollow code is the only one that will impact your SEO. Both noreferrer and noopener have no direct impact on your SEO. As they are only used by your browser and Google Analytics.

📌 In a rush? Pin this post to your Blogging or WordPress board to read it later! 📌

How To Stop WordPress From Adding Noreferrer And Its Importance

What Is Noopener?

Noopener is a tag that protects against a security flaw in browsers. That can happen when website links open in a new tab automatically. This is something you as a blogger will set when creating your WordPress links.

The security flaw, called Tabnabbing. Can result in phishing attacks. For users browsing from a safe website to one infected with some phishing code. By adding rel=noopener to your WordPress links. You are effectively protecting users against this.

There are no known disadvantages to using this tag. Only the benefits of improved security.

So you should always use this tag whenever you tell your blog post links to open in a new tab. In fact, WordPress will add these for you automatically, so you don’t have to worry about editing code.

What Is Noreferrer?

Gold And White WordPress Blogging Notebooks

Noreferrer works similarly to noopener. In that, it also protects users against the same security issue.

However, this tag also prevents information about the source page. Being passed to the newly opened tab.

This extra feature is what can cause your blog issues. As it can prevent necessary information being collected by your Google Analytics.

As when noreferrer is used for your links. Google Analytics will not know the source of your blog traffic. And will group it under direct traffic.

Rather than say, telling you it was referral traffic from Pinterest for example.

Also, the second major issue relates to your affiliate links. As noreferrer will hide information from your affiliate program.

Your affiliate links should still track and give you proper credit. As most affiliate programs pass your affiliate ID through code in the URL and cookies.

But hiding this information can get you into trouble with affiliate programs. Such as Amazon Associates. Resulting in your account being suspended. And any potential sales being lost while you try to appeal the decision.

I cover this in detail as to why it happens later on.

What Is Nofollow? Is It The Same As Noreferrer?

Many people refer to nofollow as the tag to use to prevent losing SEO link juice to external websites. However, this is inaccurate and I consider it to be an extremely common myth.

Using what is considered a dofollow link won’t reduce your link juice. Unless you are linking to a spammy low-quality site. Which you should never do anyways as you always want to provide value to your readers!

Instead, you should consider any dofollow links as more like saying to google. That you are vouching for the website’s value and information.

Nofollow is the only tag that affects your SEO. And it has completely different uses compared to noreferrer and noopener. So ensure you don’t confuse these!

What’s The Point Of Noreferrer vs Noopener Then?

Laptop For Blogging And Using WordPress With Bright Pink Notebook Glasses And White Tulips

At this point, you might be wondering. Why should you use noreferrer when it can cause so many problems. When the perfect solution is to just use noopener instead?

Well, the main reason why WordPress is suddenly using both of these tags. Whenever you add links that open in a new tab. Is because the noopener tag doesn’t cover some of the super old browsers like Internet Explorer.

It is worth noting that those browsers that do not support the fix provided by noopener. Are used by a tiny percentage of users across the entire internet.

For example, Internet Explorer is only used by around 2% of total users in reports as recent as October 2019. This number should only get smaller over time.

Internet Explorer is an old browser. And has been replaced with Microsoft Edge since its release back in 2015. Internet Explorer is increasingly unsupported. Especially considering that Microsoft will soon no longer be supporting Windows 7.

If you use or know someone who is still using Internet Explorer. Then I urge you to make the switch to another browser. As there are many limitations of using such an old browser. Especially if security is important to you.

Though what I likely think is the case. Is that this 2% might just be users resetting their pc back to default. And being stuck with Internet Explorer. Until they download another browser after that first restart.

Solutions To Stop WordPress From Adding rel=noreferrer In WordPress

Wordpress Bloggers Pokadot Pens Scheduler And Mobile Phone

So, now that we’ve covered the important information about . And why it can cause a lot of trouble for you as a blogger.

Let’s talk about how to remove noreferrer from your WordPress links. So you can avoid such problems.

For the record, official channels on WordPress. Might state that removing noreferrer is not recommended. But considering the amount of trouble noreferrer causes. And a tiny 2% amount of cases noreferrer might impact. Which to me seems like it will be less.

I recommend removing noreferrer using one of the below methods. But I want you to understand that this is just my opinion. And that you should make your own decision based on the facts above.

With that out of the way. I want to talk about the different solutions you can use. That will allow you to disable or remove noreferrer on your WordPress blog.

But before you start I want to remind you to take a backup of your blog. Since there will be some code you need to paste into parts of your blog.

As well as consider using a staging site like I have been using the free method. Since you’ll be able to test any changes first.

Okay, so you might be wondering. Why can’t you just delete noreferrer from the code for your blog posts?

Whilst this sounds like it would be a simple answer to the problem. The way the noreferrer is being added to your links. Will prevent this solution from working on its own.

Because if you delete it from your HTML and then save or update your blog post. WordPress will automatically add it back to all your links.

Yep, sometimes WordPress can be a sneaky little troublemaker like this.

So, deleting noreferrer in an attempt to disable it, will just end up with you wasting a ton of time.

Let’s look at what solutions can work instead.

Wordpress Blogger Using Laptop Keyboard And Writing In A Notebook With Google Analytics And Charts Printed Out In Front

Both the noreferrer and noopener tags are only ever added when you open links in a new tab. You could avoid the issues with noreferrer by not setting your links to open in a new tab.

But here’s the thing. Having your links open into a new tab is extremely beneficial. Especially for your audience’s reading experience.

Think about it from your own perspective. If you are reading a blog post and click on a link that provides extra context. Do you really want to lose your place where you read up to?

Or would you rather that link opened in a new tab. So you can switch to it, read it and then head back to the exact place you left off in the original blog post?

I know I prefer having links open in a new tab. And I bet your audience feels the same.

So much so, that all my links here on this blog should automatically open in a new tab for you. No extra clicks required.

1. How To Edit Your WordPress Theme’s Function File To Disable Noreferrer

One method you can use to remove noreferrer from your WordPress blog. Is by adding some code to your functions.php file that is part of your theme.

Go to Dashboard > Appearance > Theme Editor and find the functions.php file.

Where To Find Your WordPress Theme Functions File To Remove Noreferrer From Your Links

Open your functions.php file for your child theme.

If you are not familiar with WordPress child themes then check out this information here.

Paste the below code at the bottom of your functions.php file:

//This code removes noreferrer from your new or updated posts
function my_targeted_link_rel($rel_values) {
return 'noopener';
}
add_filter('wp_targeted_link_rel', 'my_targeted_link_rel',999);

(Original code source came from here)

Now, this code only removes and disables noreferrer for new blog posts. Or any that you go back and edit to going forward.

This leaves you with the problem of updating all your other posts that still include the noreferrer tag.

Besides this, these changes might be lost. If you have to update your theme and don’t have a child theme setup with the changes. Or if your child theme is from a custom developer and they update the theme.

Removing Noreferrer From Your Recently Created Or Updated Blog Posts

If you need to go back through older blog posts to remove . Then the easiest way to do this. Is to switch the Text tab in the Classic editor.

Or in the Gutenberg editor, you can switch by going to the Options button (3 vertical dots in the corner). And then clicking on Code Editor. You can also use the keyboard shortcut Ctrl+Shift+Alt+M.

How To Switch To Code View In WordPress Gutenberg To Remove Noreferrer

From here you can press Ctrl+F on your keyboard to bring up the search menu. Type in noreferrer and search your blog post’s code for it.

This will let you highlight all the noreferrer tags showing in your blog post. You can double click on these and then click delete to handle them quickly.

Overall, this process can be time-consuming if you have a lot of blog posts though. You might not even know which blog posts you need to change. If WordPress has been adding noreferrer to your links for a while before you noticed.

If you want to avoid having to do this, then this next method can potentially save you a ton of time.

From your WordPress dashboard go to Plugins > Add new.

Then search for and install the plugin Code Snippets

Once installed and activated, you’ll need to go to Snippets > Add new using the left side menu.

Give your code snippet a name and set it to Only run on site front end.

Next, we’ll copy and paste in some code. This code is the same as the one mentioned in the previous method.

So you can skip it if you’ve done it already. Or use it as an alternative to avoid problems with updating your theme later.

Copy and paste the following code into the code box:

//This code removes noreferrer from your new or updated posts
function my_targeted_link_rel($rel_values) {
return 'noopener';
}
add_filter('wp_targeted_link_rel', 'my_targeted_link_rel',999);

(Original source code came from here)

At the bottom of the screen click Save Changes and Activate.

How To Stop WordPress From Adding Noreferrer Using Code Snippet Plugin And Some Code

Next, we want to repeat the process for a 2nd Code Snippet.

So, go back and click on Snippets > Add new again.

Give the snippet a name and this time paste this code into the box instead:

// Removes noreferrer on the frontend only, you will likely still see noreferrer in the code view of the editor
function noref_formatter($content) {
$replace = array("noreferrer " => "" ," noreferrer" => "");
$new_content = strtr($content, $replace);
return $new_content;
}
add_filter('the_content', 'noref_formatter', 999);

Go to the bottom to click Save Changes and Activate.

This code will remove noreferrer from any existing blog posts that are still using it. The noreferrer will still display in your WordPress editor when viewing the code. But these are stripped out of the final code shown on the live version of your blog.

You should use this code exactly as it is. The additional spaces around noreferrer are deliberate.

Regardless of the method, you used above. You’ll want to confirm that your changes have worked.

To do this clear any cache you have set up for your blog. And then open the live version of your blog in New private window in Firefox. Or an Incognito tab using Chrome.

You can open this special type of tab. Usually, by clicking on the Options button found in the top right corner of your browser.

Next, find a link in one of your blog posts that should have been updated and right-click on it. From there you’ll want to click on Inspect or Inspect Element depending on your browser.

How To Check WordPress Has Stopped Adding Noreferrer By Clicking Inspect On Links

A window will appear with your blog’s HTML and a few lines for the URL you right-clicked on will be highlighted.

As you can see in this example, the rel=”nofollow noopener” for this link. There is no longer any set rel=noreferrer tag.

How To Stop WordPress From Adding Noreferrer On Your Live Blog

If you still see noreferrer showing. Then you need to go back and double-check the steps above.

Noreferrer is debated on whether it can affect your blog’s affiliate links. Many argue that noreferrer should have no impact on your affiliate links. As they should still track through your ID included in the URL. Plus whatever cookies are added by the browser.

Why the conflicting answers? 

Well, even with the sudden change back in WordPress 4.7. Resulted in some Amazon Associate accounts being suspended. That seemed to be related to using noreferrer to hide the origin of link clicks.

Because Amazon likes to keep strict control over the affiliate program. To ensure there are no cheaters. They often review accounts and look for information from the source URL.

Hiding the source URL, which is what noreferrer does was a violation of their terms back in 2017

Those that did get their accounts suspended. Were restored once the issue was explained. Since it was a change enforced by WordPress rather than the blogger themselves.

But I’d wager that being suspended from Amazon Associates. Probably had an impact on those bloggers’ incomes.

But that was back with 2017, what about now?

In particular, Amazon Associates Terms in 2020 state:

(v) You will not cloak, hide, spoof, or otherwise obscure the URL of your Site containing Special Links (including by use of Redirecting Links) or the user agent of the application in which Program Content is displayed or used such that we cannot reasonably determine the site or application from which a customer clicks through such Special Link to an Amazon Site.

(Source, Amazon.com)

Using noreferrer on your affiliate links is still against Amazon’s terms in 2020. This means that if Amazon reviews your account. And find your source URL information is being hidden.

Then you risk them closing your account. Which you’ll have to appeal. Meanwhile, you could be missing out on commissions.

Many other websites say that the majority of affiliate links won’t be affected by . But I think this is a pretty bold statement considering how big and popular amazon is.

It’s not clear if noreferrer only affects Amazon’s affiliate links. Some people have suggested that Shareasale has similar terms. But I haven’t been able to find it myself.

Oh and one more thing. Even if your affiliate links track correctly with . And it is not against your affiliate program terms.

You likely won’t be able to track where your affiliate sales are coming from. As the page URL will have been removed from the information used to generate reports.

Pink And White Desktop Stationary Mouse And WordPress Blogging Resources

So, there you have it. Hopefully, by now you’ll understand that noreferrer is a security fix. That also hides certain information from your links.

This hidden information is what can cause issues with your affiliate links. Specifically, because it is against Amazon’s terms. Your links should still track fine and you should still get commissions.

You’ll likely not know where these commissions have come from though.

This hidden information can also cause problems with Google Analytics. Since it can no longer tell where these clicks come from.

Meaning it will be more difficult to analyze your traffic. As well as other websites won’t be able to tell if you are sending them any traffic.

Noreferrer can be avoided if you use noopener instead. As this fixes the security issues for all modern browsers. Without any of the drawbacks that noreferrer has.

Noreferrer along with noopener are just tags. That your browser and Google Analytics pay attention to. So they have no direct impact on your SEO optimization. They may sound similar to nofollow. But they are completely different.

Will you be disabling or removing noreferrer from your WordPress links? Have you experienced or know of anyone who’s been impacted by this? Tell me your thoughts in the comments below.

📌 Enjoyed this post? Then pin this post to your best Blogging or WordPress tips board! 📌

2 WordPress Noreferrer Solutions And Why It Matters For You
How To Remove Noreferrer In Your WordPress Link Code

Related Posts:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get access to the FREE Pinterest Cheat Sheet for Mastering your websites Pins today!Download