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. Vanesss says:

    Yeah spam really is a problem, almost every time i post on a blog i see spammers, we really need to stop them, they are a plague :(

    Comment made on October 1, 2007 at 9:57 pm

  2. very good says:

    Super !

    Comment made on October 4, 2007 at 8:08 am

  3. Anna Hackman says:

    Hi Mike. I installed fire bug on my site while using firefox because my site was dragging. However, it shows an error in your valforms,js as follows:

    line 6– cform has no properties
    function applyOnSubmitToForms()
    Onload ( )

    I do not understand code so I don’t know what it means. How do I get rid of this error? anna http://www.green-talk.com

    Comment made on October 8, 2007 at 4:28 am

  4. Fraktfritt says:

    Fantastic plugin – I´m new to blogging (yes there are newbies) so I only realised the full value of your plugin this week – spam sucks

    Comment made on October 15, 2007 at 8:35 pm

  5. anyone says:

    this sounds a good idea

    Comment made on October 24, 2007 at 3:02 am

  6. Andy says:

    @Mike Jolley

    i wanna know, who’s the original author of valforms.js file? you? please tell me ! thanks you..

    Comment made on October 27, 2007 at 8:14 pm

  7. Raden Payas says:

    I have tried many anti-spam plug-in but this one is the best… Now I am using this into my blog.

    Thanks

    Comment made on November 25, 2007 at 9:38 am

  8. Regina says:

    I’m going to download this now, it seems really good!

    Comment made on November 25, 2007 at 12:58 pm

  9. Mike Jolley says:

    UPDATED!

    Comment made on December 8, 2007 at 2:11 am

  10. Gunnar says:

    First, thanks a lot for this plug-in. My blog feels much less of a chore now that I’m not wading through spam comments in the moderation queue.

    Seems like a wordpress update has caused the question to end up at the end, after the input form (I notice your form is doing this too). It’s a bit odd since the tab index is still at 3 and because people are accustomed to having the comment box last. A silver lining is perhaps that it may be odd enough to draw attention to the question. ;)

    V2 of this plug-in seems to be playing nicer with k2’s live comment feature. I just had to change the wrong answer text to remove the “hit the back button” phrase since it shows the error on the same page with all that neat AJAX goodness.

    Comment made on December 9, 2007 at 10:04 pm

  11. Mark Ðißiasio (The Scribe) says:

    Mike, Great Work! Thank you for all the hard work.

    I have installed your plug-in and find the spam question below the submit button. Any suggestion as to how to place it above the submit button?

    I do employ ‘Comment Tags’,'Subscribe to Comments’, ‘WP AJAX Edit Comments’ and ‘WP Grins’ plugins as well as yours. Could there be any conflicts?

    Another note, Firefox browser dosen’t show the Spam-stopper plugin at all.

    Comment made on December 10, 2007 at 1:53 pm

  12. Mike Jolley says:

    “Seems like a wordpress update has caused the question to end up at the end, after the input form (I notice your form is doing this too).” Damn Ill look at this. The problem is injecting the qu: I have to use JS.

    You can of course manually add the form field to solve the issue yourself!

    Comment made on December 10, 2007 at 8:28 pm

  13. Gunnar says:

    @Mike Jolley: Thanks for the tip. I had seen that in the code comments but hadn’t really thought about it. The advantage of adding it manually is I was able to make it fit the look of my theme nicely (eg. the field labels are after the fields using strong tags). A couple of comments: wordpress’s URL field also has a tabindex of 3. Also, when I copied and pasted that HTML/PHP code from the code comment, it didn’t work because there are extra spaces before and after the question marks:
    < ?php $aspamq = new WPcommentSpam(); echo $aspamq->get_spam_question(); ? >

    Comment made on December 10, 2007 at 9:43 pm

  14. Mike Jolley says:

    I know, its up to you to work out the correct code, that’s just a guide.

    Anyhow, I just updated the zip, and it should now be working.

    Comment made on December 10, 2007 at 11:48 pm

  15. Ash Haque says:

    Thanks for the cool plugin

    Comment made on December 30, 2007 at 4:30 am

  16. Alan says:

    Thank you.. I will be putting this on my blog, I am getting about 20 spam messages a day which is rather annoying!
    Regards
    Alan
    http://www.makemesomemoney.co.uk

    Comment made on December 31, 2007 at 12:17 pm

  17. Alan says:

    I keep getting an error message.. “please input a valid email”.. any ideas?

    Thanks

    Comment made on December 31, 2007 at 12:29 pm

  18. yoichi says:

    Hi,
    I’d like to use this great plugin but need to translate the text in the popup error messages into Japanese. I tried doing that in the js using wordpad but it only displays corrupted text.
    How can I change the text?
    Thanks.

    Comment made on January 14, 2008 at 4:43 am

  19. Josh H. says:

    I hope this works for me. I’m so sick of comment spam.

    And by the way, Spam Karma is a joke. It was totally confusing. I need something a mere mortal can use.

    Comment made on February 10, 2008 at 11:40 pm

  20. Jo says:

    Like this one really much.

    Might it be a “feature” that the form is although displayed when logged in if I add it in the comments-template manually?

    Comment made on February 19, 2008 at 11:01 pm

  21. Jo says:

    It’s me again. Of course, there is no need for further instructions. Just found the $user_ID-Line in comments-template. Keep it up ()-_-()

    Comment made on February 20, 2008 at 5:17 pm

  22. Jo says:

    And again. Is there a possibility to let wordpress automatically fill in the input-field? It’s because I personally use a preview-function and this in combination with the normal send-procedure forces to type the answer in twice. It would be quite cool to just type it in ounce and see/”use” it everytime you visit again/comment again. So is there a cookie-option like the one wp provides for normal name/mail/website-inputs? thx in advance

    Comment made on February 20, 2008 at 6:01 pm

  23. Ades says:

    Looks like the plugin is working great! Congrats! How is the spam rate? Did it decrease?

    Comment made on March 3, 2008 at 9:59 pm

  24. Scott Young says:

    I installed per the instructions, and the form doesn’t show up. It’s just my old form. I’ll try to edit the comment.php template, but was hoping to use the auto feature. Is the js file supposed to remain with the php file where it is initially after download?

    Comment made on March 9, 2008 at 6:41 am

  25. Scott Young says:

    oops… I’ll bet it’s that I’m logged in as admin :-)

    Yep, my fault. Works fine. Now I have to change mine to look cool like yours!

    Thanks!

    Comment made on March 9, 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 »
ThemeSlice
  • Featured work - More

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

    • @skjreilly no problem :)
  • Out of the blue - More

    • Switched: From Shared to VPS

      It’s been about two weeks now since I made the transition from a shared reseller hosting account to a VPS (Virtual Private Server) account – impressions so far, excellent performance but fiddly to configure.

      The reason I wanted to change from shared hosting was the fact the server was always being hacked (even though ALL my scripts were secure), there was frequent downtime, support blamed me for problems every time, and it was slow as hell.

      Those used to a shared hosting environment would probably not know where to start when faced with configuring a VPS. Luckily, a lot of it was pre-configured when I received my account – certainly some of the major security holes were patched. I was not satisfied with those however. As a victim of hacking in the past (previous host swears it was not there fault, something I don’t believe) I took extra care to secure it as a much I could – configuring brute force detection, the firewall, installing mod security (excellent rules for that here: http://www.atomicorp.com/wiki/index.php/Atomic_ModSecurity_Rules) and going though multiple guides (like this one: http://www.webhostingtalk.com/showthread.php?t=468168) with a fine-tooth comb.

      The result? My pages are loading at least 6 times faster, I have had no down time (or at least have not noticed any), and I feel in control and happy. No longer am I at the mercy of shared hosts :)

      If your interested, I chose ServInt as my provider as they offered a great deal, as well as being a managed service (so I’m not on my own if I screw things up). I was tempted by the bells and whistles of Media Temple, but felt the ServInt service was better value.

    • Download Monitor 3.2.2 Maintenance Release

      Download Monitor has received some more love and has been updated. Here’s the change log from the new version:

      • Small bugfix in uploader.php – cat ID
      • Changed stats graph calculation – thanks lggemini
      • Changes to headers in download.php to avoid caching
      • File Browser fixes – $root was clashing with something….
      • exclude_cat works in all sections of download_page now
      • Removed hardcoding of /uploads/
      • Added action to download.php – should be able to use it to stop a download if you want – maybe limiting downloads per day or something? Whatever you want…
      • Made it so if you post new file on ‘edit’ screen, the post date is updated.
      • Fixed the ‘blank meta’ section which blanks out custom field values when nothing is set.
      • Moved ‘allow_url_fopen’ check.
      • Someone said downloads don’t work with spaces in the name. They do! Wasting my time sonny…
      • All work and no play make jolley a dull boy
      • Had to rename capabilities so they work. Apologies if you have to set this up again! Cheers to Mark Dingemanse.
      • {category_ID} custom format tag added. Useful if you want to send someone to its category on the DL page I guess. Also added {category_other} so when no category is set “other” is shown – this is because the download page can show an ‘other’ section if you want it to.
      • You can now manually edit the post date on the edit download screen.

      If you have edited capabilities for download monitor user permissions, you’ll have to again sorry! This is because I named them too long. Also, you should check your forced downloads still work because there was a logic error meaning they may not have been forced after-all…

      Enjoy.

    • Mahousive update to Download Monitor (3.2)

      Today I completed the update for the Wordpress Download Monitor Plugin – many tweaks, fixes, and features added. There were no changes to the database structure so people upgrading should be fine. Here is the list from the change log:

      • {user} tag added for custom formats
      • ‘autop’ option fix
      • Download page buttons applied with CSS so they are easier to customise/translate.
      • Fix for pagination bug after editing a download
      • Category output fix on edit downloads screen
      • Category urls on download page use ID rather than name to prevent errors when cats have the same names.
      • exclude_cat added to download_page shortcode
      • Localised ‘hits’ ‘date’ ‘title’ on download page
      • Option to disable the download logging
      • Read file ‘chunked’ some people found large files were corrupted so this should help (fingers crossed)
      • Added show_tags option to download page – displays x amount of tags on the download page.
      • File Browser root setting and download.php logic/mime types modified thanks to Jim Isaacs (jidd.jimisaacs.com)
      • Interface Improvements
      • Bulk edit categories, custom fields, tags, member only downloads
      • Added roles for download monitor admin – should be able to use with a role manager plugin if you want anyone other than admin to access the admin section e.g. http://wordpress.org/extend/plugins/capsman/
      • Change redirect after add
      • Edit Cat names/parents
      • Dedicated tags and thumbnails fields (they still use meta table though)

      And yes, those category link bugs are fixed at long last, and you can edit category names finally. Phew!

    • Wordpress Spam Stopper Plugin Updated

      Spam stopper has been updated to v3.1 – and most of it has been recoded. Here’s the full list of changes:

      • Added changelog to readme.
      • Email validation bug squashed
      • Cached comments now work; if user forgets to fill in antispam or makes a mistake (and the JS does not catch it) the users comment will not be lost.
      • Redone entire code to make it more efficient
      • Admin section added for changing the antispam question
      • Form ID and honeypot trap added to form
      • Fully localized

      You can get the plugin from wordpress.org: http://wordpress.org/extend/plugins/spam-stopper/

      For support, please keep my comments clean and post on either the wordpress forums or my forum.

      To help support spam-stopper you can make a donation (buy me a coffee, or several) or rate it on wordpress.org. Thanks!