How to Make a Custom Scrollbar in WordPress
June 14, 2014
How to Display Most Commented WordPress Posts
June 24, 2014

How to Reduce WordPress Comment Spam using Comments Cookies

In this time, I will show you how to reduce WordPress comment spam using Comments Cookies. There are plenty of solutions to reduce comment spam. You can use CAPTCHA to block spamming bots. Using Akismet you can also effectively reduce comment spam. Remember, a growing site comes with new challenges and one of them is comment spam.

Cookies for Comments plugin works out of the box and there are no settings for you to configure. First at all, you need to install and activate the Cookies for Comments plugin.
How does it work?

Spam bots are basically software scripts that crawl the web looking for comment forms and then submit spam comments. And most of the comment spam is submitted by those spam bots.

The text on a page is enough for them to determine the presence of a comment form, so these programs don’t load images and stylesheets.

stylesheet or an image is loaded by Cookies for comments plugin when a page on your WordPress site is accessed. The plugin will set a cookie in the user’s browser if the user’s browser downloads the stylesheet or image file. Everytimes any user tries to post a comment, the plugin will always checks for the cookie. If the cookie exists, it seems to be that the user is not a bot. If otherwise, the user is most likely a spam bot, and the comment they submit is marked as spam.

How To Completely Stop It?

Cookies for Comments will successfully detect spammers, not to stop spammers to keep submit a comments. This comment goes into spam comments. With little more effort, you can stop the bots from posting their comments altogether.

You will need to find out the cookie value to do that. Right click then select View Page Source anywhere on the your website.

23jun1

This will open the page’s HTML source. Now scroll down the page to the bottom of the page until you find a line similar to this one:

[php] <img alt=’css.php’ src="http://example.com/wp-content/plugins/cookies-for-comments/css.php?k=9692e3a737ecafe8fe6329490410ff50&amp;o=i&amp;t=201927728" width=’1′ height=’1′ /> [/php]

The value after css.php?k= is the value of the cookie, as you can see in the figure above, it is 9692e3a737ecafe8fe6329490410ff50. Keep it in your hand, you will need this value in the next step.

Now, using an FTP client, you need to connect to your website and edit the .htaccess file. Paste this code before anything else in your .htaccess file.

[php] RewriteCond %{HTTP_COOKIE} !^.*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.*$
RewriteRule ^wp-comments-post.php – [F,L] [/php]

Replace the XXX with the cookie value. Now, Your .htaccess file will always look for a cookie value. It will stop the user from commenting, when the cookie is not found.

putracode
putracode
Welcome to Wordpress Mind! We aim to be a source of quality information free WordPress themes for WordPress lovers all around the world.

Leave a Reply

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

CAPTCHA HERE * Time limit is exhausted. Please reload the CAPTCHA.