# Daily Digest of New User Registrations

> Replaces the "New user registration" email WordPress sends for every sign-up with one daily email listing all new users, their role and email address.

- Type: PHP
- Runs: Run everywhere
- Category: [Email](https://wpide.com/library/category/email/)
- Tags: email, users, digest
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/email-digest-new-users/

## Code

```php
$wpide_users_digest_hour = 8;

add_filter( 'wp_send_new_user_notification_to_admin', '__return_false' );

add_action( 'init', function () use ( $wpide_users_digest_hour ) {
    if ( wp_next_scheduled( 'wpide_new_users_digest' ) ) {
        return;
    }
    $next = new DateTime( 'today ' . $wpide_users_digest_hour . ':00', wp_timezone() );
    if ( $next->getTimestamp() <= time() ) {
        $next->modify( '+1 day' );
    }
    wp_schedule_event( $next->getTimestamp(), 'daily', 'wpide_new_users_digest' );
} );

add_action( 'wpide_new_users_digest', function () {
    $users = get_users( array(
        'date_query' => array( array( 'after' => gmdate( 'Y-m-d H:i:s', time() - DAY_IN_SECONDS ), 'column' => 'user_registered' ) ),
        'number'     => 200,
        'orderby'    => 'registered',
        'order'      => 'DESC',
    ) );

    if ( ! $users ) {
        return;
    }

    $lines = array( sprintf( '%d new user(s) registered in the last 24 hours:', count( $users ) ), '' );
    foreach ( $users as $user ) {
        $lines[] = sprintf( '• %s <%s> – %s', $user->user_login, $user->user_email, implode( ', ', (array) $user->roles ) );
    }
    $lines[] = '';
    $lines[] = 'All users: ' . admin_url( 'users.php' );

    wp_mail( get_option( 'admin_email' ), sprintf( '[%s] %d new user(s)', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), count( $users ) ), implode( "\n", $lines ) );
} );
```

## Notes

Needs WordPress 6.1 or later, users still get their own welcome email, and nothing is sent on days without new registrations.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Daily Digest of New User Registrations" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
