Title: get_sitestats
Published: April 25, 2014
Last modified: April 28, 2025

---

# get_sitestats(): int[]

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#wp--skip-link--target)

Gets the network’s site and user counts.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#return)󠁿

 int[] Site and user count for the network.

 * `blogs` int
 * Number of sites on the network.
 * `users` int
 * Number of users on the network.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#source)󠁿

    ```php
    function get_sitestats() {
    	$stats = array(
    		'blogs' => get_blog_count(),
    		'users' => get_user_count(),
    	);

    	return $stats;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-functions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/ms-functions.php#L22)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/ms-functions.php#L22-L29)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#related)󠁿

| Uses | Description | 
| [get_blog_count()](https://developer.wordpress.org/reference/functions/get_blog_count/)`wp-includes/ms-functions.php` |

Gets the number of active sites on the installation.

  | 
| [get_user_count()](https://developer.wordpress.org/reference/functions/get_user_count/)`wp-includes/user.php` |

Returns the number of active users in your installation.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_sitestats/?output_format=md#changelog)󠁿

| Version | Description | 
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_sitestats%2F)
before being able to contribute a note or feedback.