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

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

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

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by bertha , 17 days 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.