apply_filters( ‘comment_flood_filter’, bool $bool, int $time_lastcomment, int $time_newcomment )

Filters the comment flood status.


Whether a comment flood is occurring. Default false.
Timestamp of when the last comment was posted.
Timestamp of when the new comment was posted.


$flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );



User Contributed Notes

  1. Skip to note 3 content

    The default time required between multiple comments from the same user/IP is 15 seconds. If the user posts the second comment faster than 15 seconds after the first comment, the comment flood message is triggered.
    Below is an example showing how to change the default time.

    function wpdocs_dam_the_flood( $dam_it, $time_last, $time_new ) {
        if ( ( $time_new - $time_last ) < 300 ) { // time interval is 300 seconds
            return true;
        return false;
    add_filter( 'comment_flood_filter', 'wpdocs_dam_the_flood', 10, 3 );

You must log in before being able to contribute a note or feedback.