How to Correctly 'nofollow' Affiliate Links with WordPress
Did you know that if your affiliate links or sponsored links aren't properly nofollowed, Google can hit your website with a penalty?
Did you also know that if you do it wrong, you can get also risk your Amazon Associates account getting suspended indefinitely?
Yeah. This is important stuff. But unfortunately, the majority of guides out there aren't up-to-date with the latest behavior of WordPress, and don't explain how to handle fixing this on an existing site.
That's why I'm here to help :)
In this post, you will learn:
- What is a nofollow link
- Why does "nofollow" even exist?
- Why should you nofollow affiliate links
- Should you use rel="sponsored" instead of nofollow for affiliate links?
- How to correctly "nofollow" a link in WordPress
- Why you should NOT leave the default WordPress "noreferrer" rel parameter
- How to remove the "noreferrer" parameter in WordPress
- Why is this so complicated?
What is a nofollow link
In code, a nofollow link on your website is a link that contains the attribute
rel="nofollow". For example:
<a href="https://google.com" rel="nofollow">Google</a>
rel attribute of the link does not need to only contain "nofollow" for it to be a nofollow link. A nofollow link
can also have other rel attributes, such as
Those extra attributes are separated by a space, like this:
<a href="https://google.com" rel="nofollow noopener noreferrer">Google</a>
Why does "nofollow" even exist?
rel attribute gives you a way to tell Google about your relationship with the website you're linking to. There are a number of qualifying parameters you can use, such as:
rel="sponsored"— Marks links as advertisements or paid placements (for example, if a brand pays you to link to them from one of your articles). This is a somewhat new attribute (announced September 2019) that describes more granularly your relationship to the linked website as opposed to simply "nofollow".
rel="ugc"— UGC stands for "user-generated content". This helps you tell Google that you, the author, did not write the link. A common place for links with this attribute would be the comments section of your blog, or on a forum.
rel="nofollow"— Nofollow tells Google that you explicitly do not "endorse" the website you are linking to. It is important to note that as of March 2020, Google is treating "nofollow" as a hint.
Google introduced the UGC and Sponsored rel attributes in order to help website owners give them more granular information about why the link should not "endorse" the target website. This is because Google uses links from external websites as a ranking factor, as you probably know.
There are also technical rel parameters, which are instructions to the web browser as opposed to Google:
rel="noopener"— A security feature that prevents pages being opened with the
target="_blank"attribute (which opens the link in a new tab) from being able to access the
rel="noreferrer"— Has the same effect as
noopenerbut also strips the
Refererheader from being sent to the new page.
Why should you nofollow affiliate links
In short, Google considers affiliate links to be "paid links". And if you don't nofollow those links, it may warrant a manual penalty.
If you're not familiar with how manual penalties work in Google, in essence your website can be flagged for having unnatural outbound links. There is a Manual Actions Report in Google Search Console where you can see these penalties, fix the issue detected, and submit your site to be reviewed. It is then reviewed by a real person.
The big deal is that having a penalty against your site can cause your rankings to drop dramatically or remove part of all of your website from being discoverable in Google.
Should you use rel="sponsored" instead of nofollow for affiliate links?
Google recommends using
for affiliate links, however there is no penalty for continuing to use
nofollow if, for example, you don't want to go update all the links on your website.
How to correctly "nofollow" a link in WordPress
Nofollow affiliate links using a plugin
Yoast is pictured above, but it works the same for Rank Math but without the additional
In general, opening affiliate links in a new tab is a good idea. Ideally you want people to be able to easily return to your website if they decide not to purchase the item being linked to.
You can decide whether you'd like to also use the
sponsored attribute or not. In reality, Google probably already knows which links
are affiliate links for a large number of websites (here at Affilimate we have our own affiliate link detection algorithm, so it's fair to assume Google
is even further along 😉).
But as you don't want to get any kind of penalties, you should always mark your affiliate links at least with
nofollow. So go ahead and check all three options:
Those little switches simply results in WordPress writing a bit of code for you, which now looks like this:
<a href="https://www.amazon.com/gp/product/link-to-a-product" target="_blank" rel="noreferrer noopener sponsored nofollow"> Amazon </a>
You will see FOUR
Importantly, we will use a plugin to remove the
noreferrer attribute. I'll explain why below.
Nofollow affiliate links directly in the code
You can also make these changes yourself by editing the HTML of your post or page in WordPress.
Your existing link probably looks something like this:
And you just want to add this in between before the first
> in the link:
target="_blank" rel="nofollow noopener sponsored"
This tells the browser to open the link in a new tab with
target="_blank", and uses the
to tell Google the link is nofollow and sponsored, and tells the browser not to allow access to
window.opener (a security feature).
Why you should NOT leave the default WordPress "noreferrer" rel parameter
Have you ever wondered where your direct traffic in Google Analytics is coming from?
While there are a number of possible sources like email, documents like PDFs, some social media apps, and so forth, one source people often forget to write about is direct traffic as a result of the rel="noreferrer" attribute on a link.
If someone links to your website and has a
rel="noreferrer" parameter on it, the browser strips out the information about where the visitor was coming from before they landed on your website.
In other words, noreferrer masks the source of traffic to a given URL when used on a link.
And there are numerous affiliate programs, including both Amazon and many Amazon Associates alternatives, that explicitly state in their Terms of Service that you may not mask where a click came from:
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.
If you leave
rel="noreferrer", which WordPress appends automatically to all links that open in a new tab, you are objectively violating this requirement.
That's just how browsers work.
Not only that, but there are plenty of networks like Skimlinks and Shareasale that can give you useful analytics about which page referred a given commission...if you don't have
on your affiliate links.
(I have helped numerous people fix this issue on their WordPress websites so they could get the full benefits of the built-in analytics of affiliate networks)
Besides the affect on your affiliate links, don't you want people who are getting referral traffic from you to see that in their analytics?
Not everyone is monitoring every backlink they receive, and it's kind of nice to see someone linking you and sending you traffic and just say "Thanks!"
Background story: Why does WordPress add noreferrer in the first place? Noreferrer and noopener have the same security features, however the reason WordPress adds both is because noopener is not supported in Internet Explorer 11.
IE11 is used by approximately 1.42% of people globally. It is important to note that these security features are for visitors to your website, and do not improve the security of your website in any way. You can use Google Analytics to find out what percentage of people visiting your website are using IE11, but there is a strong business case for dropping Internet Explorer support regardless.
IE11 has already been dropped by websites like Meetup, Yahoo!, Zendesk, YouTube, and others.
How to remove the "noreferrer" parameter in WordPress
I cannot tell you how crazy it makes me to have to install a plugin to get rid of
noreferrer, but that's the world we live in.
You can try removing
noreferrer manually inside your HTML, but infuriatingly, WordPress adds back noreferrer even after you removed it intentionally from a link.
If you end up using it and it solves this problem, consider buying the developer a coffee (I did). He could be saving your commissions 😉
Why is this so complicated?
That's the million dollar question, isn't it.
All you wanted to do was play by Google's rules and have your links properly attributed as affiliate links, and now we've just spent ages together deciphering exactly how to do it with WordPress — without violating any terms of the affiliate programs you're in.
It would be nice if WordPress allows us to toggle the
noreferrer attribute for links in a new tab in a future update. Until then, I hope this post is helpful for you!
If you got value from this article, consider sharing it with the next person who asks this question in a Facebook group! And as always, you can sign up for our mailing list for future tips for affiliates.
Thanks for reading and may your commissions be plenty ✌️
Looking to up your game? Join our mailing list!
No spam, just awesome affiliate tactics. Straight to your inbox. Unsubscribe anytime.
Hi there! I'm a Monica, one of the co-founders of Affilimate. I blog, I code, and above all else I drink coffee.
Follow Monica Lent at @monicalent