More comment flood
Thanks for visiting! If you're new here, you may want to subscribe to our RSS feed. This blog posts regular Wordpress news, updates of themes, plugins, ideas, hacks, quick fixes and everything about blogging, especially about Wordpress. Go ahead, subscribe to our feed! You can also receive updates from this blog via email.
Addendum from my previous post about comment flooding, this is what I would change the code in my wp-comments-post.php (between the comments, you should recognize the place):
// Simple flood-protection
$lasttime = $wpdb->get_var("SELECT comment_date FROM $tablecomments 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) < 300)
die( __('Sorry, this blog only allows a new comment once every 300 seconds. If you really want to write a comment, just wait a few and hit refresh on this page. Chances are you tried to add a comment about halfway between 0 and 300 seconds. Comment flooders are annoying. Thank you for being patient.') );
}
My own MySql server is messed up (because my mysql server is screwy AND in a different time zone than my web server, figure that) but it should work. If something breaks, I will try it on another server.













Comments RSS
Nice idea Mark, any chance of releasing it as a plugin so users dont have to hack the wp-comments-post.php file directly?
[...] not eliminated the spam completely. I have found another suggestion on Weblog Tools - to increase the minimum time between posts. Wordpress’ default settin [...]
[...] another hack involves increasing the time between comment submissions, a method that works to stop spammers that “flood” your comments, but does nothing to [...]
Thumbs up! I put my vote in for a plugin also, this would be great. Thanks for the wp hack Mark.