How to Fight spams in 4 simple steps – Explained

After starting my wordpress blog ,within few days some of posts starts toping the Google chart , I was very happy by seeing that but it caused an unwanted problem for me i.e I started getting spam emails and spam comments on my posts.On an average I was getting 50-100 spams everyday and I was really pissed of these spams , so I thought instead of running away from them I have to fight with these spams.So next question is How to fight spams, In this post I am going to focus on what all measures I have taken to avoid spams and gave a rock solid answer to these spammers.

How to fight spam in 4 simple steps

Below are the steps that I have taken(and you can also ) to combat with these spams .

  1. Akismet : I am sure that whoever belongs to blogging world and more specifically who have their blog hosted on the wordpress platform is aware of what Akismet do. Akismet is wordpress plugin and has been installed by default when you move your blog on wordpress platform. So, whenever anybody commented on your posts / articles , it never get published automatically , it always comes to you for moderation where you can decide to approve , delete or mark it as spam. So, Akismet is providing you basic level of shield against these spams but it always requires manual intervention from your side as you have to take action on each and every individual comment. Its a basic thing that every blog should have and highly recommended by experts.
  2. Notification for Readers : One more thing that I noticed when I received comments from my readers , I saw that the same comment is appeared multiple times from the same user and after looking at the content they was not looking as spam , so there was something wrong with my blog . After thinking over it and ofcourse doing some research on it, I found that there is problem with at my end not at the reader’s end. The problem was that whenever any of reader is submitting a comment I was not telling them , your comment is under moderation because of that readers think that there comment has been lost and they post the same comment again.

To overcome this problem we have a very simple solution , you have to add a single line of code in your comments.php or comments-popup.php depends which ever is present in your system. Try to look for the below line of code in the file –

<p>
<input name="submit" type="submit" tabindex="5" value="<?php _e("Say it!"); ?>" />
</p>

You have to add this line of code , before the input statement .

<blockquote>
We have received your comment and it will be published shortly Thanks for your interest.
</blockquote>

So, finally whole code will look like this.

<p>
<blockquote>We have received your comment and it will be published shortly.
</blockquote>
<input name="submit" type="submit" tabindex="5" value="<?php _e("Say it!"); ?>" />
</p>

how to fight spam in 4 simple steps

3.       Update .htaccess file : Generally this option is not recommended until you are very well aware of the Apache Server architecture because touching this file can impact your website in the other way. This file can be updated in the case when you are able to identify any patterns in the comment e.g If you know comments from this IP address are always spams , you can add that IP address in .htaccess file and restrict the users from these IP address and they will not be able to visit your site. You can use the sample code mentioned below :

Add this line of code in your file :

deny from IP_ADDRESS_1

deny from IP_ADDRESS_2

Here , IP_ADDRESS_1 and IP_ADDRESS_2 are the IP addresses that you identified and you want them to block. You can add as many IP addresses you want each in a new line. In my case I used to get lot of spams from domain 123mail.net , so I blocked that completely.

4.       Introduce Quiz or Captcha : To avoid all the system generated spams you can introduce a type of quiz that will ask some simple question to the reader before posting the comment. This way you can ensure that only humans are commenting on your site not bots. One of such plugin that I use for my blog is here. You can download this plugin and install it .

By adopting the above posted approaches you can definitely avoid the spams to great extent , I am not saying this it will sort out spamming problem completely. Actually honestly speaking there is no such software available in the market that can resolve this problem 100%.

There are lot of other ways also available by which you can reduce the spam quantity , but I found these four most suitable for my blog and they worked like charm. Believe me after doing all this, time spend in moderation of comments has been reduced and the same time I started utilizing in other improvement of my blog.

Thanks for visiting and please share your thoughts and experience on preventions of spams.

Image Source : 3spam.com and allspammedup.com

Let'sConnect

Saurabh Jain

A Developer working on Enterprise applications ,Distributed Systems, Hadoop and BigData.This blog is about my experience working mostly on Java technologies ,NoSQL ,git , maven and Hadoop ecosystem.
Let'sConnect
Add Comment Register



Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>