Search

Comment Spam Trap Wordpress Plugin

About the Comment Spam Trap Wordpress Plugin

Tested in: Wordpress 2.0.X – 2.6.x

Comment Spam Trap is a simple plugin that kills comment spam, including the hated trackback spam. This is my first wordpress plugin, and I made it because I was fed up with all of the comment spam. Since it works so well, I decided to share it.

Comment Spam Trap kills spam in 3 ways:

  • Invisible Email Field
    The plugin adds an invisible email field that is invisible to
    human visitor, but very visible to the spam bots. When they fill it in, the message is
    considered spam.
  • One Extra Required Email Field
    Just to confuse the spam bots further, an identical email field is added,
    with the only difference being that this on is visible, and must be filled
    in.

None of these methods will be 100% fool proof, but from my
experiences, they have all but eliminated by comment spam issues.

DOWNLOAD


You can download the Comment Spam Trap here: download comment-spam-trap (zip file 12KB)

INSTALLATION


1. Download and UnZip the Zip Archive
When you have unzipped the plugin, there should be a folder called wp-cstrap that contains 3 files.

  • comment-spam-trap.php
  • style.css

2. Upload the entire wp-cstrap directory to your Wordpress plugins directory.

3. In your Wordpress Plugins administration panel, activate the Comment Spam Trap plugin.

4. That’s it. Comment Spam Trap is now relieving you of comment spam. By default, you will not be notified when comments are trashed, but if you would like to be notified, you can edit the comment-spam-trap.php file and add your email address. See the configuration instructions below.

CONFIGURATION


1. Do You Want All Caught Comment Spam Emailed To You?
The plugin trashes all spam messages, but to be on the safe side, you can have all messages emailed to you (or your enemies :) ). Just fill in an email address below.
Like This:

$cst_email = ‘example@yourdoman.com’;

2. Error Message Options
Just in case we get some humans setting off these traps, we have some nice warning messages to help them along. Feel free to change these.

$invisible_field_message = “Thanks but dont fill out that field. :) ”;
$required_field2_message = “Thanks, but please verify your email. :) ”;

Feel free to ask questions, or share comments here.

If you enjoyed this post, make sure you subscribe to my RSS feed!



20 Responses to “Comment Spam Trap Wordpress Plugin”

  1. ogletree Says:

    I use spam karma and it does just fine.



  2. javier Says:

    I also use spam karma. It is cool



  3. Jonathan Says:

    Neat! I’m using a contact form that has the same basic principle. There’s a hidden (commented out) Bcc field that cannot be completed if the email is to be sent. Of course, it’s then passed through Akismet for good measure, but the first barricade stops all but the most well-written crapbots.



  4. B Jones Says:

    Some of you may have noticed that I removed the feature that checks trackback spam. Evidently, this feature could be a security issue. Someone could use your site to do DDOS attack by continually sending trackback requests with the victim sites url. Or by using a number of sites with this plugin, and sending hundreds of requests to each Comment Spam Trap site with the same victim url. This would result in all of the host sites requesting from the victim site at the same time.

    So, though it really worked well, I have decided to remove the trackback feature. This isn’t really an issue for me, since only a very small percentage of my spam is trackback spam, and if it gets bad, I can always disable the trackbacks.



  5. moonswamp Says:

    HI,I’VE Collcet this plugin in my blog:
    http://www.tearsea.com/?p=551

    great plugin and thanks~~~



  6. fmontero Says:

    I have been using this plugin for a couple of days now and it’s working like a charm. I like that it is very simple to install and it starts working right away (Plug and Play?). I had been thinking about installing akismet all this time, but the registering part of it had kept me from doing it (yeah I know I’m lazy).

    It has been a 360 degrees change for me in terms of spam (I’m even enjoying having the email confirmation thing on and seeing all that damn spam go fishing!). I have a similar plugin for my phpbb forum. These are probably my 2 favorite plugins right now. I am not a technical blogger so user friendly plugins are essential for me.

    Thank you Mr. Jones!



  7. B Jones Says:

    Cool. Glad you liked it fmontero. What’s the url for the phpbb plugin?



  8. Dave Smith Says:

    I installed this plugin three days ago. I had the email to me turned on and it works wonderfully. It is very easy to install and activate. I’ve installed it another one of my blogs and turned off the email to me on the first one. It is great to have a plugin this simple and effective against spam.

    Thanks so much, I’ll be passing the word along in a blog post. I want everyone to know about this great plugin.



  9. Matt Keegan Says:

    I just added this option to one blog and will be adding it to three others. Many thanks for the work that you put into developing a highly useful plug-in!



  10. Dave Smith Says:

    You have an offending in your code. It causes a validation error.

    It is just above the line:

    It ends below the end div statement. I’ve removed the code and it works fine and validates. apparently enclosing a div inside a p is offensive, go figure.



  11. B Jones Says:

    Dave,
    Thanks for pointing this out, but I think your code didn’t show up. It’s just above the line??? Which line?

    Thanks,
    Badi



  12. Zeth Says:

    Hello,

    I implemented the plugin and it is a very good idea.

    However, it fails to distinguish between a spam robot and a few types of human, namely those using text-only browsers such as Lynx, elinks and certain visually impaired technologies.

    I think this could be improved a little, or if not then perhaps the false positive page could be a little more helpful?

    One approach would be to pre-loading hidden values with the previously submitted values and then asking one more question. How would I do that with this plugin?



  13. free affiliate programs Says:

    my theme came with an integrated spam filter, but I don’t think it’s much good, hopefully this one is better?



  14. Make Money At Home On The Internet Says:

    I need a new spam filter for my up and coming blog, looks like a good start



  15. Sam Freedoms Internet Marketing Controversy Blog Says:

    Comment 24 is just priceless…



  16. Mihai Says:

    It’s a little too complicated..I think Spam Karma does it’s job good :) .



  17. Charles Says:

    Its not foolproof. Manual spam still works, as evidenced by the comment by ENLARGEMENT!



  18. B Jones Says:

    Hey Charles.
    It’s definitely not fool proof. Manual comments still work, but that’s sort of the point :)

    This plugin does stop the flood of automated spam comments though.



  19. hekim group Says:

    Just in case we get some humans setting off these traps, we have some nice warning messages to help them along.



  20. oyun Says:

    I just added this option to one blog and will be adding it to three others. Many thanks for the work that you put into developing a highly useful plug-in!



Leave a Comment