Hello guys, I’m back to give you another insight about NoFollow tag. After I show you how to use it for label widget and comment box, this time we will learn how we can automatically make all our external links as NoFollow. The reason why you should add rel=’nofollow’ is to prevent search engine like google, yahoo, bing, etc to not index or follow all external link you have on your blog post.
One thing to remember though, sometimes we add our own link on a post that maybe related to another article. If you want to add NoFollow tag manually so you still have control. However, if you don’t wanna be bother to check them one by one, you can just automatically add the tag. Just follow the instruction below:
1. On your blog dashboard, click Template section, and click Edit HTML button.
2. Copy – paste code below above/before </head> tag.
<script src=’http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js’ type=’text/javascript’/>
<script type=’text/javascript’>
<![CDATA[
jQuery(‘a’).each(function(){var a=jQuery(this).attr(‘href’);if(typeof a!=’undefined’&&a!=””&&(a.indexOf(‘http://’)!=-1||a.indexOf(‘https://’)!=-1)&&a.indexOf(window.location.hostname)==-1){jQuery(this).attr(“rel”,”nofollow”)}});
]]>
</script>
3. Save your template.
Comment below if you have question.