# New Sign-Ups per Month Dashboard Widget

> Adds a dashboard widget showing how many people registered in each of the last six months, with simple bars, so you can see if your community is growing.

- Type: PHP
- Runs: Run everywhere
- Category: [Users](https://wpide.com/library/category/users/)
- Tags: users, dashboard, statistics
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/signups-per-month-widget/

## Code

```php
add_action( 'wp_dashboard_setup', function () {
    if ( ! current_user_can( 'list_users' ) ) {
        return;
    }

    wp_add_dashboard_widget( 'wpide_signups_month', 'New sign-ups per month', function () {
        global $wpdb;

        $rows = get_transient( 'wpide_signups_month' );

        if ( false === $rows ) {
            $since = gmdate( 'Y-m-01 00:00:00', strtotime( '-5 months', time() ) );
            $rows  = $wpdb->get_results( $wpdb->prepare( "SELECT DATE_FORMAT(user_registered, '%%Y-%%m') AS month, COUNT(*) AS total FROM {$wpdb->users} WHERE user_registered >= %s GROUP BY month ORDER BY month", $since ), ARRAY_A );
            set_transient( 'wpide_signups_month', $rows, 6 * HOUR_IN_SECONDS );
        }

        $totals = wp_list_pluck( (array) $rows, 'total', 'month' );
        $max    = $totals ? max( array_map( 'intval', $totals ) ) : 0;

        echo '<table class="widefat striped" style="border:0"><tbody>';

        for ( $i = 5; $i >= 0; $i-- ) {
            $time  = strtotime( gmdate( 'Y-m-01' ) . " -$i months" );
            $count = (int) ( $totals[ gmdate( 'Y-m', $time ) ] ?? 0 );
            $width = $max ? round( $count / $max * 100 ) : 0;

            printf(
                '<tr><th scope="row" style="width:30%%">%1$s</th><td><span style="display:inline-block;height:10px;width:%2$d%%;min-width:2px;background:#2271b1;border-radius:2px;vertical-align:middle"></span> %3$s</td></tr>',
                esc_html( wp_date( 'M Y', $time ) ),
                (int) $width,
                esc_html( number_format_i18n( $count ) )
            );
        }

        echo '</tbody></table>';
    } );
} );

add_action( 'user_register', function () {
    delete_transient( 'wpide_signups_month' );
} );
```

## Notes

Uses one grouped query, cached for 6 hours. Visible to users who can list users.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "New Sign-Ups per Month Dashboard Widget" 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/
