Can you Keep Spam Comments at Bay with Cookies in WordPress?

Spam comments are a huge problem for some WordPress users. As your site grows, spamming programs will find you and start to target your site with unwanted comments.

There are some great ways to block spam including the Akismet plugin and adding a CAPTCHA plugin to your site. However, these are not the only ways to block spam. You can also do it through Cookies.

Using the Cookies for Comments WordPress Plugin

The Cookies for Comments WordPress Plugin can help eliminate spam comments from your WordPress website. Install and activate this plugin and it will work right out of the box. You won’t need to configure anything or change any settings.

How does the Plugin Work?

Most of the spam comments you receive don’t actually come from an actual person. Instead, they come from spam bots. These bots are actually software scripts that spend their time looking for comment forms and posting comments. Since these programs are used to submit thousands of comments, they don’t load images or stylesheets from websites. They just load the text to figure out if there is a form for a comment.

When you install the Cookies for Comments plugin, it will load an image or stylesheet on a page when it has been accessed. When this happens, the user’s browser will install a cookie. If a user tries to post a comment and the cookie isn’t present, the plugin will identify them as a spam bot. The comment will also be marked as spam and submitted as spam.

Can you Completely Block them From Posting a Comment?

If you want to use this plugin and completely block the spam bots, you will need to change a little bit of code. This is done by finding the cookies, which you can do by right clicking on your website and selecting “view source” from the menu.

View Page Source

Now, you will have a new tab open with the code for your website. You will need to scroll to about the middle of the source code and look for a code that looks like this:

Cookie Code


The cookie value is the string of number and letters found after the css.php?k=. In the code above it is, 9634eab89e9d848c824a68ddc6118c93.

You will need to connect to your website with your FTP client and edit the .htaccess file. You will just need to enter this code before anything else in this file to block spam comments with this plugin completely.

HTaccess Code

Replace the strings of XXXXX with your cookie value.

If you follow these steps and use the cookies for comments plugin, you will be able to block the comments coming from spammers in WordPress.

Leave a Reply

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

Please enter the answer: Time limit is exhausted. Please reload CAPTCHA.

ITX Design is a Web Hosting and Domain Registration provider. We provide dedicated servers, shared web hosting, and domain registration for small businesses including Reseller Hosting, FFmpeg Hosting and Christian Web Hosting.
featured on the news
Switch to mobile version