Automatically Hide Spam Links In Blogger Comments - Helper Blogger

Blogger Widgets | Templates | Tutorials

Latest

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="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
Now search for </body> tag and add below code just above it
<script>
    $('.comment-content a[rel$=nofollow]').replaceWith(function() {
        return ($(this).text());
    });
</script>

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
<script>
    $('.comment-content a[rel$=nofollow]').hide());
</script>

Disadvantages
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.

4 comments:

  1. I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. research paper writing service, research paper service

    ReplyDelete
  2. Thanks for sharing this information I really enjoyed reading this article we are opencart custom module development if you are looking for any web development pls visit us.

    ReplyDelete
  3. At the end of the day, the bank won't run your record of loan repayment while deciding if to affirm you for an advance. This is the reason purchasers with terrible, almost no credit at all discover these kinds of advances so engaging. If also need any help to visit here auto title loans chicago

    ReplyDelete

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