How to Add the Nofollow Tag to a Link

Updated August 13, 2018

When a search engine robot (“bot”) lands on a page on your site, it crawls through and reads the text on that page. This is the way it figures out what your page is about, a vital step in SEO.

Once it knows what your page is about, it can index your page and show it in search results when people are looking for that type of content.

But sometimes it’s not so straightfoward.

What about links?

As the bot crawls through your page and comes to a link, it follows that link and crawls the page you linked to as well. The link is like a door to that other page and the search bot goes through the door (link) and reads the next site too.

Whenever you link to another page on the internet, you are basically telling the search engine, “Hey search engine, here’s a page I like and I think you should go read it too.”

It’s like you’re giving the linked page a thumbs up. It’s also referred to as “passing PageRank.”  In other words, you’re spreading Google love and “voting” for that linked page.

And the search engine says, “Hey, thanks for the suggestion! I’m always looking for more sites others like, so I’ll be sure to check it out.” Then off it goes through the door. It crawls that site and adds it to its arsenal of good sites to put in search results.

This is what makes the internet go round. (Or at least search.)

But not all links should get a thumbs up from you

There are times when you don’t want to, or shouldn’t, give a thumb’s up to another page when linking to them. Google has a good rundown, but I’ll give you the gist:

  1. Maybe you’re linking to a site you can’t exactly vouch for so you’re not entirely comfortable casting a favorable vote for it.
  2. Maybe you’re linking to a forum or some other site that requires registration or a login. Because bots can’t register or log in, it’s not really helpful for them to visit that site. In that case, it’d be better for that bot to stay on your site and explore your site a little more.
  3. Maybe you’re linking to a site that is somehow advertising-related or a site from which you’ll make money, like an affiliate link or a sponsor. Search engines are interested in keeping their search results clean and not influenced by paid relationships, so this isn’t a good time to give a thumbs up either. Google has written more about this and reminds site owners that passing PageRank to sites with whom you have this sort of relationship (including receiving any free product) goes against their terms of service. Also, do not forget to disclose your relationship in those posts as well. I wrote more about that here.

Enter the nofollow tag

So, what’s a site owner to do? Is there a way to link (so your readers can check it out) but not give a “thumb’s up” to the search engines? Why yes, yes there is.

Use the nofollow tag.

The nofollow tag on a link tells a search engine not to follow that link. Essentially, you are closing the door to that link so the bots don’t go there.

Always use the nofollow tag when:

  1. You link to a site you don’t want to “vote” for or can’t vouch for.
  2. You link to a site that requires a login or registration.
  3. You use an affiliate link or are linking to a site with whom you have a some sort of paid or compensated relationship. If you get free product, are provided giveaways, get paid to post, earn affiliate commission, are awarded credit or are otherwise compensated in any way, you must make the link nofollow.

How to add the nofollow tag to a link

Don’t see the video? Click here.

Step 1: Write your page or post.

Step 2: Add a link to your text as you normally would. (In WordPress, simply highlight the text you want to be the link and click the link icon at the top of the post input window.)

Step 3: Switch to HTML mode. (This is easily done in WordPress by switching from the “Visual” tab to the “Text” tab at the top of your post window.)

Step 4: Find your link in the HTML. A link looks like this:

<a href="">Some Link</a>

Step 5: Now, add the tag rel=”nofollow” within the <a> tag like so (bolded here so you can see it):

<a href="" rel="nofollow">Some Link</a>

If you have an affiliate link, it might look more confusing because it’s longer, but the concept is the same.

The key is to grab just the URL part of your affiliate link (the part that starts with “https” and doesn’t include any quotation marks or spaces or tags).

For example, let’s say your affiliate link looks something like this:

Adding the nofollow tag would look like this:

<a href=""nofollow">Some Link</a>

That’s it! That link is now a nofollow link.

Is there an easier way to add a nofollow tag to links?

Well, yes, in WordPress you can find plugins that allow you to do it quickly. However, as you may know, I don’t recommend using a plugin to do so. I explain why in my tips about plugins.

21 thoughts on “How to Add the Nofollow Tag to a Link”

  1. This is really detailed explanation with screenshots. Do you recommend keeping some “good” links in order to improve page rank? Or multiple links impact negatively on page rank?

    Thanks for the great information!

  2. We made the mistake of starting out on a site, so there aren’t any plug-in options. We also can’t actually add in no-follow links using this method. These are all such great tips, but I thought it would be worth it to mention just in case anyone else here has this problem!

  3. Awesome, important, and easy to understand advice on a topic that isn’t glamorized and beat to death already on the web but that deserves attention.

    I love how clean the 1-3 steps are and then the illustration of how to do it. Very cool. Very helpful.

    Thank you Amy for making it easy to understand this topic and to address it properly. 🙂

  4. This is a wonderful post, and I’m definitely going to examine my posts and add the nofollow tag throughout.

    Thank you for such a useful ‘blogging tip!

    1. I would definitely start from this point forward. Going back, I might tackle it a bit at a time, starting with your most popular archived posts. I don’t think I’d kill myself trying to catch everything (and there might be even a quicker solution if you googled it).

  5. There is a great plugin for that called NoFollow Link. Just highlight your link and click the NoFollow button that the plugin installs. It doesn’t look like it does anything, but when you click from Visual to Text you can see that the link has the nofollow code in it.

  6. Do you know how many times I have said to my computer, “You’re the best, Amy.” I have been trying to find a good answer to the nofollow question for a while. Thanks for helping me to understand. 🙂

  7. Hey Amy,

    Thanks for the tutorial, very helpful. Is there any way to do this when using a 3rd party that runs my ads in my sidebar. I use passionfruit to run some ads in my sidebar so wondered if this could be added to that shomehow too.


    1. Hi Mel,

      Great question. I believe some ad networks already back the nofollow tag into their code. You might check with Passionfruit to see if they do so.

Comments are closed.