# Network Overview Widget in the Network Dashboard

> Adds a widget to the Network Admin dashboard with totals for sites, users, archived, spam and deleted sites, and the five newest sites.

- Type: PHP
- Runs: Admin only
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: network-admin, dashboard, statistics
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-network-dashboard-stats/

## Code

```php
if ( ! is_multisite() ) {
    return;
}

add_action( 'wp_network_dashboard_setup', function () {
    wp_add_dashboard_widget( 'wpide_network_overview', __( 'Network overview' ), function () {
        $rows = array(
            __( 'Sites' )    => get_blog_count(),
            __( 'Users' )    => get_user_count(),
            __( 'Archived' ) => get_sites( array( 'archived' => 1, 'count' => true ) ),
            __( 'Spam' )     => get_sites( array( 'spam' => 1, 'count' => true ) ),
            __( 'Deleted' )  => get_sites( array( 'deleted' => 1, 'count' => true ) ),
        );

        echo '<table class="widefat striped"><tbody>';
        foreach ( $rows as $label => $value ) {
            echo '<tr><td>' . esc_html( $label ) . '</td><td style="text-align:right"><strong>' . esc_html( number_format_i18n( (int) $value ) ) . '</strong></td></tr>';
        }
        echo '</tbody></table>';

        $newest = get_sites( array( 'number' => 5, 'orderby' => 'registered', 'order' => 'DESC' ) );

        if ( $newest ) {
            echo '<h3 style="margin-top:1em">' . esc_html__( 'Newest sites' ) . '</h3><ul>';
            foreach ( $newest as $site ) {
                printf(
                    '<li><a href="%1$s">%2$s</a> <span style="color:#646970">%3$s</span></li>',
                    esc_url( network_admin_url( 'site-info.php?id=' . (int) $site->blog_id ) ),
                    esc_html( $site->blogname ? $site->blogname : $site->domain . $site->path ),
                    esc_html( mysql2date( get_option( 'date_format' ), $site->registered ) )
                );
            }
            echo '</ul>';
        }
    } );
} );
```

## Notes

Counts come from WordPress's own cached network counts and a single sites query.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Network Overview Widget in the Network Dashboard" 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/
