Wednesday 15 May 2013

Remove hyperlinks from blogger comments


Hello Readers, in this post I will tell you how to remove hyperlinks from the comment section of your blogger blog for better SEO optimization. Comments are the soul of every blog and it shows us the popularity of every blog. But sometimes people just spam their hyperlinks in your comment section for their link building. You do all the hard work to write good quality blog posts and people don't even care about writing a good comment for your article rather than they just leave a hyperlink to their Webpage. To stop this kind of link spamming I am writing a tutorial which will remove the hyperlinks from your comment section and will leave simple text behind.
remove hyperlinks blogger comments
Before we start with the tutorial, there are a few questions that I would like to answer. Let us see these FAQs:

Why should you remove hyperlinks?

A few years ago people used to spam their hyperlinks in high PR blogs and website to gain good rankings easily. Though Google has updated its algorithms to fight with this kind of link building but still some people follow this technique. Hyperlinks can harm you in many ways like if you have not made your comment section nofollow yet; you are unknowingly gifting back links to many websites. Too many back links will affect the overall SEO optimization of your blog and will result in a lower Google PR or even 0PR.

What should you do?

I recommend you to remove the hyperlinks from the comment section or at least make them nofollow so that it won't affect your site much. If you don't do this, you will allow your traffic and link juice to flow to the external WebPages.

Recommended Articles:


Got own hyperlinks in Comments?

Sometimes we help our online readers by providing them our own links in comments. Don't worry you won't lose them, this script will only external hyperlinks.

Will it affect the Page Load time?

No, it won't affect the page load time. We will be using a small Jquery script which is a lighter and stable version of JavaScript. This script will run after the page load so you need not to worry about the page load time, it will remain the same.
Now let us start the tutorial, I will post two methods to remove/replace the hyperlinks from the comments section. In the first method, we will replace the original hyperlinks with the hash (#) and in the second one we will completely remove the hyperlinks.

Method I:

This method will help you replacing the hyperlinks with hash (#).

  • Login in to your Blogger Account and navigate to the Dashboard.
  • Take back-up of your blogger blog. It is recommended to take back-up before any editing to the blogger template.
  • Now click on Edit HTML.
  • Press CTRL+F to find the starting <head> tag.
  • If you don't have Jquery included in your blogger template, add the following code just under head tag:
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js' type='text/JavaScript'/>
  • Now under this code, add the following lines of code:
<script type='text/JavaScript'>
$(document).ready(function()
{
$(&#39;.comment-content a[href*=&quot;http://&quot;]:not([href*=&quot;YOUR_WEBSITE_NAME_HERE&quot;])&#39;).attr(&quot;href&quot;,&quot;#&quot;);
});
  • </script>
  • Click on Save and then view blog.
Open any post on which you have hyperlinks in comments and check it. The original hyperlinks are replaced by hash (#) and clicking on them won’t take you anywhere.

Note: The above method will not remove the hyperlink styling and it will look like the original hyperlink with a hash in “href” attribute.

Method II

This method completely removes the hyperlink and hyperlink styling. Follow the same steps mentioned above till point number 5, which is adding the Jquery.

  • Now add the following lines of code under the Jquery code:
<script type='text/JavaScript'>
$(document).ready(function()
{
$(&#39;.comment-content a[href*=&quot;http://&quot;]:not([href*=&quot;YOUR_WEBSITE_NAME_HERE&quot;])&#39;).removeAttr(&#39;href&#39;).css(&#39;text-decoration&#39;,&#39;none&#39;).css(&#39;color&#39;,&#39;black&#39;);
});
</script>
  • Click on Save Template and then view blog.
Note: In my case I wrote my blog name without http:// and www but you might need to write it. Check it with/without http:// and www.
You have successfully removed the hyperlinks and hyperlinks styling. To check open any post in which you have hyperlinks. You will find plain text at the place of hyperlinks. The above two methods are developed and tested by me. I am using the Method-II and it is working fine on my blog. You can check my article 10 killer SEO tips, it has only one hyperlink now and that too is my own hyperlink.  If you face any problem with the above tutorial or have any doubt, you can comment here. I will be Glad to assist you.

You can check our SEO optimization and Blogging tips section for more cool tips/tricks and tutorials. It will improve your blogging experience.

If you like my work; you can show your regards by hitting Facebook like button, following us on Google+ or Twitter, stumbling our posts on stumble upon or giving us a link back via the links below. Stay tuned for more tech updates.

KKXACXPS3PJY

Do you like this post? Please link back to this article by copying one of the codes below.

URL: HTML link code: BB link code:
author pic
Author: Mohammad Zafar Ahmad
Zafar Ahmad is PHP/Java Developer and a Passionate Blogger. He likes to write about Blogging tips, SEO tips, Blogger Widgets, Smart phones, Tablets and Online Earnings. You can find him on Facebook, Twitter or Google+

No comments:

Post a Comment