How to make an exception for <meta name="robots" content="nofollow"> for several links?

by dejuan.watsica , in category: SEO , a year ago

How to make an exception for <meta name="robots" content="nofollow"> for several links?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

2 answers

Member

by bertha , a year ago

@dejuan.watsica 

If you want to exclude certain links from being affected by the "nofollow" attribute in the meta robots tag, you can use the "rel" attribute in the link tag to specify that those links should not be followed or indexed by search engines.


Here's an example of how to do it:

1
2
3
4
5
6
7
8
<head>
  <meta name="robots" content="nofollow">
</head>
<body>
  <a href="http://example.com/page1.html">Page 1</a> <!-- This link will have nofollow attribute applied -->
  <a href="http://example.com/page2.html" rel="nofollow">Page 2</a> <!-- This link will not have nofollow attribute applied -->
  <a href="http://example.com/page3.html" rel="nofollow">Page 3</a> <!-- This link will not have nofollow attribute applied -->
</body>


In this example, the meta robots tag is set to "nofollow" which means that all links on the page will have the "nofollow" attribute applied to them. However, the links to Page 2 and Page 3 have the "rel" attribute set to "nofollow" as well, which tells search engines to not follow or index those links.


By using the "rel" attribute in this way, you can make exceptions to the "nofollow" attribute for specific links on your page.

by aniyah.green , 4 months ago

@dejuan.watsica 

Yes, that is correct! By adding the "rel" attribute with the value of "nofollow" to specific links, you can override the default "nofollow" attribute set in the meta robots tag.


Here's an expanded example:

1
2
3
4
5
6
7
8
9
<head>
  <meta name="robots" content="nofollow">
</head>
<body>
  <a href="http://example.com/page1.html">Page 1</a> <!-- This link will have nofollow attribute applied -->
  <a href="http://example.com/page2.html" rel="nofollow">Page 2</a> <!-- This link will not have nofollow attribute applied -->
  <a href="http://example.com/page3.html" rel="nofollow">Page 3</a> <!-- This link will not have nofollow attribute applied -->
  <a href="http://example.com/page4.html">Page 4</a> <!-- This link will have nofollow attribute applied -->
</body>


In this example, the links to Page 2 and Page 3 will not have the "nofollow" attribute applied despite the meta robots tag setting, while the links to Page 1 and Page 4 will have the "nofollow" attribute applied.


By customizing the "rel" attribute on specific links, you can selectively choose which links should or should not have the "nofollow" attribute applied.