Using WordPress ‘admin_email_remind_interval’ PHP filter

The admin_email_remind_interval WordPress PHP filter allows you to modify the interval for dismissing the admin email confirmation screen.

Usage

add_filter( 'admin_email_remind_interval', 'custom_admin_email_remind_interval' );

function custom_admin_email_remind_interval( $interval ) {
    // your custom code here
    return $interval;
}

Parameters

  • $interval (int): Interval time (in seconds). Default is 3 days (259200 seconds).

More information

See WordPress Developer Resources: admin_email_remind_interval

Examples

This example completely disables the “Remind me later” link by returning 0.

add_filter( 'admin_email_remind_interval', 'disable_remind_me_later' );

function disable_remind_me_later( $interval ) {
    return 0;
}

Set a custom interval to 1 day

This example sets the interval to 1 day (86400 seconds).

add_filter( 'admin_email_remind_interval', 'set_one_day_interval' );

function set_one_day_interval( $interval ) {
    return 86400;
}

Set a custom interval to 1 week

This example sets the interval to 1 week (604800 seconds).

add_filter( 'admin_email_remind_interval', 'set_one_week_interval' );

function set_one_week_interval( $interval ) {
    return 604800;
}

Double the default interval to 6 days

This example doubles the default interval to 6 days (518400 seconds).

add_filter( 'admin_email_remind_interval', 'double_default_interval' );

function double_default_interval( $interval ) {
    return $interval * 2;
}

Set a custom interval based on user role

This example sets different intervals for administrators and other user roles.

add_filter( 'admin_email_remind_interval', 'custom_interval_based_on_role', 10, 2 );

function custom_interval_based_on_role( $interval, $user ) {
    if ( in_array( 'administrator', (array) $user->roles ) ) {
        // Set interval to 1 day for administrators
        return 86400;
    } else {
        // Set interval to 1 week for other user roles
        return 604800;
    }
}