Iklan

Jquery No Follow All External Links

Jquery No Follow All External Links

Nofollow is the value for the rel attribute in an HTML element that aims to instruct search engines to not explore the link so it does not affect the ranking in the search engine index. Usually rel = "nofollow" added to the external links or links that lead to the outside of the website or blog.

To make it easier to add rel = "nofollow" on external links automatically, we could use jquery. It is useful to overcome the external links were added outside of our control such as in a forum that allows members to create posts. Thus, although members of the forum made a post by applying an external link, then the link will automatically add rel = "nofolow".

To use an external jquery this nofollow link rel Please copy the code below and save the above code </ body> and make sure we've put that script library jquery his work. In addition to adding rel = "nofollow", this script also add target = "_ blank" so that external links open in a new tab when a link is clicked.

<script type='text/javascript'>
//<![CDATA[
$("a").filter(function(){return this.hostname&&this.hostname!==location.hostname}).attr('rel', 'nofollow').attr('target', '_blank');
//]]>
</script>

Good luck....

Next
Prev Post
Previous
Next Post

1 comment:

  1. Thanks a lot, but how can i make any cloaked affiliate link nofollow and to open in new window?

    Example: site.com/go/* to open in new window and nofollow, while leaving every other directory the way it is on the same site.com/

    ReplyDelete