Answers

Question and Answer:

  Home  WordPress Theme Development

⟩ Explain me how do I prevent comment flooding?

Comment flooding is when a lot of comments (probably spam) are posted to your website in a very short duration of time. This is only one aspect of the broader problem of comment spam in general, but it can quickly overwhelm a moderator’s ability to manually delete the offending comments.

WordPress manages the worst floods automatically by default. Any commenters from the same IP or e-mail address (other than registered users with manage_options capabilities) that post within 15 seconds of their last comment gets their comment discarded. The time setting can be changed by a number of plugins that extend this functionality. You might also consider one of the many broader spam blocking plugins, such as Akismet, or even turning your comment system over to Disqus.

You could also just change the time setting by directly hacking the core file, but the correct way would be to create and install a very basic plugin and insert the following code:

function dam_the_flood( $dam_it, $time_last, $time_new ) {

if ( ($time_new – $time_last) < 300 ) // time interval is 300

return true; // seconds

return false;

}

add_filter(‘comment_flood_filter’, ‘dam_the_flood’, 10, 3);

 159 views

More Questions for you: