How to avoid spam comments in blog/web page/contact page

How to avoid spam comments in blog/web page/contact page

There are numerous way to control spam comments.

Akismet, the boss of anti-spam plugin

Akismet is the most popular WordPress package, it also earns the privilege with the great quality. When the comment is posted on the site/blog, it runs thousands of tests. If the test say ‘yay’ the comment goes to live, but if the test say ‘nay’ the comment goes to the ‘spam’ folder. It prevents both automated spam and manual spam.

Disabling direct access to wp-comment-post.php with htaccess

You can always disable direct access to the wp-comment-post.php file by adding code in .htaccess file.

<IfModule mod_rewrite.c>

RewriteEngine On


RewriteCond %{REQUEST_URI} .wp-comments-post.php*

RewriteCond %{HTTP_REFERER} !.*yourdomainname.* [OR]

RewriteCond %{HTTP_USER_AGENT} ^$

RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]


If the referrer isn’t from your blog,  it does not allow the file to be accessed. Another advantage using this code is, spam robots will not raise your server’s resource usage, since they can’t access the file. It prevents Automated spam.

The ‘Cookies for Comments’ plugin

This plugin prevents both Automated and manual spam. The plugin simply checks how fast the comment is sent. For example, When the comment is sent within 3 minutes when the post page is loaded, its probably spam. You can also set the interval from the option page, along with the choice to deal with the ‘caught comments’. Set them as spam or delete directly.

Using a different comment system(Like Facebook comments, Jetpack and Disqus)

The comment system load inside the iFrame so the spam robots cant deal with them. Use other comment systems, if your receiving more spam comments in your website. They have more functionality, looks nice and they make visitors happier. It prevents automated comments.

CAPTCHA plugins

It prevents Automated spam. It is the least option to control spam, but it is also one of the most effective way to prevent comment spam. It contains two specific plugins- reCaptcha and Captcha. Using Captcha we can prevent spam by requiring human feedback.

Leave a Comment

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