WordPress Themes Development Question:
Download Job Interview Questions and Answers PDF
Explain me how do I prevent comment flooding?
Answer:
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);
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);
Download WordPress Theme Development Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell me how do I disable trackbacks and pingbacks? | Tell me how to hide the top admin bar at the frontend of WordPress 3.4? |