M
M
Marty McFly2019-02-06 17:42:01
JavaScript
Marty McFly, 2019-02-06 17:42:01

Onclick location.href - search engines won't ban you?

Hello!
There is a task to hide referral links on the site a little.
Something like this -

<a rel="nofollow" onlick="myFunction()" href="http://example.ru">site.ru</a>
<script>
function myFunction() {
  location.href = "http://example.ru?reflink";
 return false;
}
</script>

Well, actually the question is - how will the search engines react to this? In fact, the transition will still be to the same site, and rel="nofollow"..
Maybe wrap this thing in < noindex > ?
Maybe there is some smarter option?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RusTorg, 2019-02-06
@alex_shevch

You can just leave it like this

<span onclick="myFunction()" class="link">site.ru</span>
<script>
function myFunction() {
  location.href = "http://example.ru?reflink";
 return false;
}
</script>

We use this method for all external links, because search engines no longer always look at and rel="nofollow"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question