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!!

11 thoughts on “Anti-Spam Comment Check Box

  1. 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. 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. 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. 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. 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.

Comments are closed.