It Beginneth
Sunday, January 9th, 2005In the past day or two I’ve received five comment spams, and have manually deleted them all using the clunky Wordpress interface. In the long run having to do this every time would drive me mad, so it’s time to implement some kind of anti-spam solution. Browsing around at the various complicated options, it appears that this is one situation where "rolling-yer-own" is the way to go… Just the way I like it.
Stage One is now in place, and for all I know it may turn out to be all that is required to stop [automated] spams. It’s pretty basic, involving an invisible custom field in the posting form.
It will be interesting to see if it works.

January 25th, 2005 at 12:09 am
Not trying to rip your code off, just a question from someone with the same issue. How do you generate the comment_request_ID, comment_post_ID and redirect values, and how do you check against them in your template?
Fascinating blog, million miles from what I do.
January 25th, 2005 at 1:13 am
To be honest I don’t know whether the code is really doing me much good [i
am still deleting about 3 spams a day, which for all intents and purposes
seem to be manually entered… perhaps javascript will stop these?] The
original spams i was getting seem to have stopped, but that may be due to
the fact that I renamed my wp-comments-post.php file
FWIW, those values are generated and checked thusly…
Generating the form:
comment_request_ID = (time() ^ 0×55555555)
comment_post_ID = $id
redirect_to = $_SERVER[”REQUEST_URI”]
Validating the fields:
$comment_request_ID = $comment_request_ID ^ 0×55555555;
if ($comment_request_ID > time() || $comment_request_ID < time() - 3600)
die(”Error!”);
January 25th, 2005 at 1:31 am
makes sense, thank you! I think the most practical suggestion is renaming the comments file. cheers!