Google follows URL from data-href?

Asked

Viewed 484 times

2

On my site there are links to certain Urls that open with Jquery and the data-href attribute. This attribute is inserted into a normal div that functions as a button.

Ex.:

<div class="open_url" data-href="http://www.exemplo.com.br">

Google usually follows this URL?

  • the data-something attribute is attribute to store data, you can capture it using: var url = $('.open_url').data('href'); and take like this: <a href="'+url+'">link</a>

  • Perfect, Ivan. But the URL the way I left it on data-href can be followed by Google, I wish it wasn’t.

  • Rafael, in that case maybe you should use the attribute rel="noindex, nofollow"on the link

  • Carlos, but would use rel= in a DIV as shown in the question? There is no link, but a DIV that represents a button.

1 answer

1

The data-href is a variable that was created for HTML to be able to trigger Java Script events, so this is extremely normal and no, Google does not follow as if it were a <a href=""> since it is a completely different use attribute.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.