Thredolsen
Thredolsen

Reputation: 257

Designating "nofollow" attribute on links in <div>

I have the following code in a website footer:

<div class="examples-footer">
    First text <a href="http://example.com/" target="_blank">Example</a> 
    Second text <a href="http://example.com/something" target="_blank">Example2</a>
</div>

I would like to designate the two links there as "nofollow". However, I can only manipulate the output by inserting additional text/html tags right after

<div class="examples-footer">

and before

First text <a href="http://example.com/" target="_blank">Example</a> 

Just inserting the <rel="nofollow"> tag there won't work; is there a way to do this using the HTML markup under the constraints which I specified, or is it impossible?

Upvotes: 1

Views: 2521

Answers (1)

Derek Henderson
Derek Henderson

Reputation: 9706

If you don't want bots/crawlers/spiders to follow any links on the page, use the robots meta tag in the head:

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

If you don't want search engines counting a link for page ranking, use the rel attribute in the link:

<a href="//stackoverflow.com" rel="nofollow">

Neither of these will prevent a human being (or cat) from following a clicked link, of course.

Upvotes: 1

Related Questions