Understanding rel="nofollow" and noindex in HTML Links: What They Really Do and How to Use Them Effectively
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:
Usenofollow
when you donât want to endorse a link. Usenoindex
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.
Comments ()