Automatically Hide Spam Links In Blogger Comments - Helper Blogger

Blogger Widgets | Templates | Tutorials


Tuesday, 27 February 2018

Automatically Hide Spam Links In Blogger Comments

Controlling spam is a headache of every blogger. If you are the only single person who manages the blog then it is a challenge to stop spam or delete spam messages. Also, As blogger does not provide an effective spam controlling mechanism this is very essential to take action on your own.
Spam comments leave a bad impression on your visitors leaving a message that the article is outdated or the blog is no longer being maintained by the author.

Here I present a simple and easy to install trick which will hide spam links and text completely while by using another method you can just remove the link but keeps the text as it is.

Methods to hide spam
  • Method 1: Completely remove link text as well as the link using CSS.
  • Method 2: Only remove link and keep the text
  • Method 3: Completely remove the link as well as text using script.

Whats the difference?
So the major difference in these both methods is that in first method we will use a simple CSS code which will completely hide link as well as link text and in the second method we gonna use a small jquery script to only remove link without touching the text and the third one will be same as first but using jQuery instead of CSS.

For which method should I go for?
This totally depends on you as all the methods do not require any special configuration and require only one-time installation. 

Before making any changes to your blog design, it is always recommended to take a backup of  your current template. 

Method 1: Completely remove link as well as text - Using CSS
  1. Log in to your blogger account
  2. Select your blog if you have more than one
  3. Now go to Theme > Edit Html
  4. Search for ]]></b:skin> and add below code just above it
.comment-content a { display: none;}

Method 2: Remove link but keep the text - Using script
This method and last method requires jQuery library present on your blog, But make sure that jQuery library is not present already on your blog.
To install latest jQuery library just add below code just before of </head> tag
<script src="" type="text/javascript"></script>
Now search for </body> tag and add below code just above it
    $('.comment-content a[rel$=nofollow]').replaceWith(function() {
        return ($(this).text());

Method 3: Completely remove link as well as text - Using script 
This method is same as the second method which requires a jQuery library. Add following code just before of </body> tag
    $('.comment-content a[rel$=nofollow]').hide());

Although this trick will help you to fight spam there are some limitations to it. Like even if an author of the blog included a link to comment, the link will not be displayed. Also if someone directly put URL address then it will be displayed and same applies to the author comments.

I hope you guys find this trick useful. Also, don't forget to share this trick with your blogger friends.

No comments:

Post a Comment

If you want to be informed about any replies then check "Notify me" option (present at lower right corner of comment box and it will display if you are logged in to your google account). PLEASE DO NOT SPAM