Anti-Spam Comment Check Box

In her comment, Jen asked about the anti-spam check box feature I use.

The hack was originally written by Otsukare (who is in charge of WordPress Japan site) and fully explained in Japanese here:
WordPress Japan Wiki: Anti Spam

Well, I translated it so here you go!

In wp-comments.php on line 78, add the following check box (right before the “submit” button).

<input type="checkbox" name="spam_guard_check" value="1" /> Please Check

In wp-comments-post.php on line 41, find this :

if ( '' == $comment )
die(_LANG_WPCP_ERR_TYPE);

And add this right after it:

$spam_guard_check = $_POST["spam_guard_check"];
if(!$spam_guard_check){
die("Please check here before posting your comment.");
}

(You can modify the messages if you want)
It’s been working wonderfully and I haven’t got any spam comment for a couple of weeks (as of 2/11/05, I’ve got only one spam comment so far. 1 in 10 days- not bad, right?).
It’ll only take 3 minutes to set it up. Well worth a try!

update: 🙁 I am starting to get some spams even with this hack. I still believe it’s better to have than not to, though..

Another Update: I upgraded this blog to WP1.5, and got rid of this check box hack. Instead, I am trying out Bad Behavior plugin… Thanks for your comment, Niklas!!


Posted

in

by

Comments

11 responses to “Anti-Spam Comment Check Box”

  1. Jen Avatar

    hi nao! thanks for taking the time to e-mail me. i really appreciate it!

    so after much frustration i found out that it was a bug from the previous version of wp that was giving the weird /smilies directory link. i changed my site-url through phpmyadmin and it worked!

    the comment filter checkbox is such a great idea. very easy to install! i’m just so sick of spam comments, lol.

    thanks again!!
    ~jen

  2. gurge Avatar

    hi! this is a great idea! I’ve implemented it, but when i checked my blog the next day, there’s still comment spam. Any idea why? Thanks in advance!!

  3. Nao Avatar

    Still getting spams? Hmm… I still haven’t got any yet,(2/8/05 update: I got the first one since this implementation! 🙁 ) and the only reason I can think of why it’s not working for you is maybe the spammer is posting comments mannualy?
    Sorry I can’t help you much…
    p.s. if you are getting trackback spams, try this:
    Trackback And Pingback Moderation

  4. Takuya Avatar

    I’m trying to manage Japanese and English posts on WordPress for my official blog. What I did was to create two seperate folders called “en” and “ja” and installed WordPress Official to “en” folder, and planning to install Multilingual Edition to “ja” folder on my site.

    Would you mind if you share a bit of your experience with WordPress? It would be great, if you could tell me the structure of your site, to understand the best way to manage both languages.

  5. reparacion ordenadores Avatar

    Three rules for the spam game:

    1) you can not win.
    2) you can not draw.
    3) you can not leave the play.

    Greetings,

    Antonio from Malaga (Spain)

  6. Nao Avatar

    Hi Takuya,
    What I did here is the same as you explained. I installed two separate WordPress, one under http://detlog.org/ and the other under the subdomain http://blog.detlog.org/. (I used Multilingual version for both of them)
    You’ll also need separate sets of SQL tables for each blog.

    That’s the only solution I could think of when I started, but I just found this WordPress “multiblog” project:
    http://mu.wordpress.org/
    http://wordpress.org/support/topic.php?id17728
    This could be an alternative to what we’ve been doing.

  7. Niklas Avatar

    Here’s an URL to a fairly new anti-spam plug-in for WordPress.: http://www.ioerror.us/software/bad-behavior

    Check it out. It seems very thought-through, and the developer is good at listening to people who have good ideas.

  8. Nao Avatar
    Nao

    Thanks Niklas!
    I am giving it a try…
    I hope this is the ONE!

  9. Jelisca Avatar

    I appreciate that you keep this blog going and allow comments. To me feedback is an interesting part of a blog.

  10. Hexiumboy Avatar

    Feedback and no spam.. Blog on!

  11. […] de mettre des cases à cocher avec des noms à la con. Le code est supra-simple (merci à deux trois gens qui utilisent la même grosso-modo la même […]

%d bloggers like this: