add_filter('comment_flood_filter', 'suren_comment_flood_filter', 10, 3); function suren_comment_flood_filter($flood_control, $time_last, $time_new) { $seconds = 600; if(($time_new - $time_last) < $seconds) { return true; } else { return false; } }
在上面600数字代表间隔的秒时间,我们可以根据实际需要修改。将脚本放到当前主题的Functions.php文件中,即可生效。