With traffic comes spam. This I know. But popping on my laptop this morning, I was confronted with 114 emails to my main account, all but 3 of which were comments waiting to be approved. Of those 111 comments awaiting approval, 109 of them were spam. I spent the last 3o minutes or so looking around for a real quick plug until I can sit down and install something a bit beefier.
Here are three things you can do in 10 minutes to reduce comment spam on WordPress. Now granted, there are better fixes, but it is Superbowl Sunday and I am just looking for a band aid right now.
The first thing you can do is simply to turn up flood control. The default is 10 seconds between comments. I noticed that the 109 that I got all came within about 10 minutes, so I changed the flood control to 300 seconds between comments. Go to wp-comments-post.php and make the change here:
// Simple flood-protection
$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments WHERE comment_author_IP = '$user_ip' ORDER BY comment_date DESC LIMIT 1");
if (!empty($lasttime)) {
$time_lastcomment= mysql2date('U', $lasttime);
$time_newcomment= mysql2date('U', $now);
if (($time_newcomment - $time_lastcomment) < 250)
die( __('Sorry, you can only post a new comment once every 250 seconds. Slow down cowboy.') );
Continue Reading...