WordPress Comment Spam Stopper plugin

February 20, 2007 | Published in: Wordpress & plugins | Tags: , , , , 124

Wordpress Comment Spam Stopper pluginEveryone hates spam, comment spam especially within wordpress. Sure there are plugins out there to reduce what shows up on your blog, a key player being Askimet, but I felt sorry for poor askimet, having to deal with literally thousands of spam messages.

Spamming is a common problem, I was getting (at least) 1000 spam messages a week, and I was sick of it. I’m sure also having so many spam messages stored in the database (even if identified by askimet) must have a speed impact on your blog.

Therefore I have created a simple solution to stopping spam at the source: asking a simple question that bots are too stupid to know in the comment form. I know only get about 10 spams per week, rather than 1000!

WordPress Comment Spam Stopper plugin

The whole idea to this plugin is to keep spammer robots from posting on your blog, reducing the space taken by spam messages in the database, and reducing the stress of being a spam magnet.

This plugin adds a field to the comment form which much be answered in order to post.

You can ask anything, keep it simple and obvious, e.g. Is the sky Green? NO!. Doing this will stop stupid bots from being able to post.

It only shows up when you are logged out, so you dont have to fill it in if your an admin. On top of this, it also adds javascript validation to the form to ensure the required fields are filled in.

To see it in action…make a comment! I’m using the plugin in this blog, obviously.

I’d like to thank Mike Cherim at http://green-beast.com/ who originally added this spam question to the WordPress PHP contact form plugin.

Get it now!

You can get the latest version from the wordpress plugin database; Download it here!


Installation

  1. Unzip and upload the php file to your wordpress plugin directory
  2. Activate the plugin

Configuration

Open the plugin file in a text editor and follow the instructions there in order to change the anti-spam question and disable auto-inserting the anti-spam field (useful if using a custom comments template).

If you are using a template which does not call wp_head() in the header file, you will need to open the plugin in a text editor, find the css styles/JS include and paste these into your header file manually.

Licence

WordPress Comment Spam Stopper plugin v2 © Copyright 2007-current. All rights reserved.
Mike Jolley

You are free to use this application but may not redistribute it without written permission.
Use of this application will be at your own risk. No guarantees or warranties are made directly or implied.
The creators cannot and will not be liable or held accountable for damages, direct or consequential.

Support my sweat, blood and tears

I put a lot of effort into all of my plugins; its thirsty work so why not show your support by buying me a nice coffee :)

Found this post useful? Why not buy me a coffee!

Related Entries

124 Responses to “WordPress Comment Spam Stopper plugin”

RSS feed for comments on this post.

  1. joel says:

    I have inserted it, but the textbox shows up below the button at the bottom of the form. How do I get it to go above the button?!

    Comment made on March 26, 2008 at 1:45 am

  2. Mike Jolley says:

    @joel – the JS should move it, if its not working for you then manually add the form input to your comments template. See inside the plugin file for instructions.

    Comment made on March 26, 2008 at 1:51 am

  3. Leven says:

    what should i do to convert /wp-content/plugins/wp-comment-spam-stopper/ into /wp-content/plugins/wp_comment_spam_stopper/

    Comment made on April 19, 2008 at 3:25 pm

  4. Mike Jolley says:

    Why would you want to do that?

    Comment made on April 19, 2008 at 5:52 pm

  5. dan says:

    great plugin. worked perfectly. required some modification to my comment template since its a customized ajax one but nevertheless it works great!!

    One question though. is it an easy task to add more questions and have them appear randomized? to turn $this->spam_question = “Is Fire hot or cold?”; into an array or something?

    Comment made on April 24, 2008 at 12:46 am

  6. Milio says:

    Nice

    Comment made on May 9, 2008 at 9:28 am

  7. Laine says:

    thank you! i’ve been getting dozens of spam comments too lately!!

    Comment made on May 11, 2008 at 3:43 pm

  8. jocuri says:

    good

    Comment made on May 30, 2008 at 10:15 pm

  9. Mike says:

    Testing!

    Comment made on August 2, 2008 at 11:33 pm

  10. Mike Jolley says:

    New version good to go!

    Comment made on August 2, 2008 at 11:39 pm

  11. Oyun says:

    New version good to go.!!

    Comment made on August 6, 2008 at 11:01 pm

  12. Jon says:

    Testing with no JS

    Comment made on August 14, 2008 at 10:18 pm

  13. Jon says:

    Hi Mike, thanks for a great plugin! I just implemented on my site, and the functionality and JS validation work great. But then I disabled JS (to verify accommodations for users with JS disabled and to combat the possibility of bots with JS disabled) and comments sailed right through, completely ignoring the spam question. I thought maybe it was my implementation, but I just tested on your site and it does the same thing.

    I’m very familiar with xhtml/css/js/php, but I’m not very familiar with the WP plugin architecture or the WP framework as a whole. I see the ‘check_comment’ function in your plugin file, and the code appears to be set up to do exactly what I am looking for it to do. I also see that you are adding this as a filter to ‘preprocess_comment’, which again seems like it’s exactly right. However, nothing in the ‘check_comment’ function seems to be executing, and I was unable to run any basic traces within the function which leads me to believe it might not be being called. I’ve read the documentation, scanned through the comments on your site and tried to dissect things myself, and at this point I’m at a loss. Any insight you can provide would be greatly appreciated! Currently using WP 2.5. Thanks!

    Comment made on August 14, 2008 at 10:46 pm

  14. paolo says:

    testing your plugin ;)

    Comment made on September 6, 2008 at 12:20 pm

  15. rap says:

    testing your plugin

    Comment made on October 4, 2008 at 9:12 pm

  16. Tony says:

    I downloaded the latest version and found it did not work at all.

    You need to add the following to the function WPcommentSpam_head()

    global $aspamq;

    Then it works like a dream :)

    Thank you for this excellent plugin!

    Comment made on October 5, 2008 at 1:25 pm

  17. George says:

    this is a test comment

    Comment made on October 26, 2008 at 7:33 pm

  18. Blogshop says:

    step by step thank you

    :-)

    Comment made on November 9, 2008 at 6:06 pm

  19. Anil says:

    looking for spam fighter plugin and found this. thanks a lot

    Comment made on November 24, 2008 at 7:10 am

  20. fake air jordans says:

    exactly what I need!

    Comment made on November 28, 2008 at 9:29 am

  21. toki says:

    Excelent…

    Comment made on December 5, 2008 at 8:30 pm

  22. Marlou says:

    Just testing your plugin. Seems exactly what I was looking for.
    Thank you so much!

    Comment made on December 8, 2008 at 9:43 am

  23. KAVEH says:

    hi guys.
    its worked in wp 2.7 ?
    im tested it in localhost and not worked…

    Comment made on December 18, 2008 at 10:39 pm

  24. smith says:

    Is this wp 2.7 work ?

    Comment made on December 20, 2008 at 2:55 am

  25. Hayden says:

    This is a test comment.

    Comment made on December 20, 2008 at 6:46 am

The comments are closed.

About this site

Blue Anvil is the online web design journal & portfolio of , a web designer from Norfolk, England. Read More »
MiniCard Theme for WordPress
  • Featured work - More

    • Beefjack
    • Integrity
    • theotaku.com
  • Latest Tweet - More

    • RT @jameskoster: Free MacBook Pro vector; http://www.potatoestomatoes.co.uk/technical/free-macbook-pro-vector/ #vector #resource
  • Out of the blue - More

    • Closing the Forums

      Just posting to let current users know that I’m closing the forum on Blue-Anvil. This is mainly due to spam-registrations getting out of hand and being a general nuisance. I will be posting good topics as FAQ items within posts if applicable.

      Please note that you can still post and get help for my plugins/themes by posting on the wordpress.org website.

    • Show off your MiniCard!

      Are you a user of the WordPress MiniCard theme? Its been downloaded over 14,000 times so far!

      If you have used it as-is, made your own child-theme or done something creative with it, please show off your MiniCard’s in the comments, I’d love to see how the theme is being used!

    • Spam Stopper updated for WordPress 3.0

      My Spam Stopper plugin has been updated for WordPress 3.0 (version 3.1.3) – you can grab it here. Sorry this update took longer than my other plugins but this one gets less lovin’ – if you want to change that feel free to donate, spread the word, or rate it on the WordPress.org plugin page.

    • SexyBookmarks & Tr.im

      Just a notice to users of the brilliant http://www.sexybookmarks.net/ plugin by shareaholic – If you use tr.im (as I have on a few client sites) be aware tr.im has ceased operation so you may see errors on your blog or in your source code; it screwed up the background and headings on one of my blogs.

      To fix, go to sexybookmarks options, switch services in the “Which URL Shortener?” box, and tick the box to reset all short urls. Once done, your blog should return to normal.