Weeding Out Spam Comments
Posted in Tech
Forenoon watch, 4 bells (10:10 am)

Until someone writes a copy of what my friend Mike wrote (ReverseDOS) that I can use with WordPress in a Linux environment, I'll keep experimenting with anti-spam comment measures. My latest idea comes from perusing my logfiles and noticing that most spam comments are posted directly to the comments page and aren't being http-referred there from another page on my site. A simple code addition to the comments page (wp_comments_post.php, line 49 or so) should fix that:


if(!ereg("bogomip.net", $_SERVER['HTTP_REFERER'])) {
die(__('Error: Spam comments are not allowed here.'));
}

Obviously, you could substitue your own server name for mine. Or not, if you don't want any comments. You could also be more restrictive: ereg for "^http://bogomip.net/blog/" … I prefer not to, because my site is sometimes reached by www.bogomip.net. I suppose I could do ereg("^http://(www\.)?bogomip.net/", $_SERVER['HTTP_REFERER']), but come on, what's the point?

1 Comment »
Tesla Coil-ed
Forenoon watch, 3 bells (9:50 am)

This guy is cool, although I bet he's been hit by a few of those bolts from his Tesla Coil himself—just listen to the way he talks...

Leave a Comment »