Understanding rel="nofollow" and noindex in HTML Links: What They Really Do and How to Use Them Effectively

Understanding rel="nofollow" and noindex in HTML Links: What They Really Do and How to Use Them Effectively
Photo by Blake Connally / Unsplash

When it comes to controlling how search engines interact with your website, two of the most commonly misunderstood attributes are nofollow and noindex. Many developers and SEO practitioners use them without fully grasping their differences or their proper placement. This article dives deep into how these attributes work, how to use them correctly, and what caveats you should be aware of.


🔗 What is rel="nofollow"?

The rel="nofollow" attribute is used inside an <a> (anchor) tag to tell search engines like Google not to follow the hyperlink.

Example:

<a href="https://example.com" rel="nofollow">Visit Example</a>

This means:

  • The search engine will not pass link equity (PageRank) to the linked page.
  • It discourages spammy behavior, especially in user-generated content like blog comments or forums.
  • The link may still be crawled if it's discovered elsewhere, but not because of this specific link.

When to use nofollow:

  • You don't trust the linked site.
  • It's a paid or sponsored link (per Google’s guidelines).
  • You want to avoid passing SEO value to certain external resources.

❌ What about noindex?

The noindex directive is meant to tell search engines not to index a page, which means the page won't appear in search results.

However, here's the critical point:

❗️Search engines do not honor rel="noindex" on anchor tags.

This is a common misconception. Unlike nofollow, putting noindex inside an <a> tag like this:

<a href="https://example.com" rel="nofollow noindex">Example</a>

...will not prevent https://example.com from being indexed. If your goal is to prevent indexing, the target page itself must contain the following tag in its <head> section:

<meta name="robots" content="noindex, nofollow">

Or be blocked via robots.txt.


✅ Correct Usage Summary

Goal Correct Approach
Prevent search engines from following a link rel="nofollow" in the <a> tag
Prevent a page from appearing in search results Add <meta name="robots" content="noindex"> to the target page
Block both crawling and indexing Combine robots.txt rules and <meta> robots tags

🧠 Additional Considerations

1. Google’s evolving behavior

Google introduced the concept of link attributes as hints, not directives, meaning they might choose to follow a nofollow link if they think it’s important enough. This applies especially after March 2020.

So even if you use nofollow, Google might still crawl the target URL — it just won’t pass ranking signals.

2. sponsored and ugc attributes

Google also introduced two more link relationships:

  • sponsored: For paid/sponsored links.
  • ugc: For user-generated content.

You can combine them:

<a href="https://example.com" rel="nofollow ugc">User submitted link</a>

3. Don’t rely on rel="noindex"

If you’ve been using rel="noindex" inside links, it's important to know that this does nothing in most search engines. Focus on proper meta tags or X-Robots-Tag headers instead.


🛠 SEO Best Practices

  • Use rel="nofollow" when linking to untrusted or promotional content.
  • Never assume rel="noindex" on links does anything.
  • If you control the target page and want to keep it out of Google, use:
<meta name="robots" content="noindex, nofollow">
  • Want to completely block crawling? Use:
User-agent: *
Disallow: /secret-page/

in your robots.txt.


🔚 Finally

Understanding the distinction between nofollow and noindex is crucial for anyone involved in SEO, content creation, or web development. While nofollow can control link behavior, only proper use of meta tags or robots.txt can control indexing.

So next time you're placing a link and thinking about SEO, remember:

Use nofollow when you don’t want to endorse a link. Use noindex when you want to hide a page from search results. But don’t mix them up.

Let search engines do their job—but on your terms.

Support Us