> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Displaying the user count in WordPress

> Learn how to display the user count on WordPress pages by adding a brief code snippet to the functions.php file of your theme.

This article describes how to display the user count on [WordPress](https://hosting.com/hosting/platforms/wordpress-hosting) pages.

If you are running a WordPress site with a large user base, you may want to share the registered user count with all of the visitors to your site. By doing so, you can help encourage them to sign up as well. Many new customers or users equate a large following (or user base) to trust. Additionally, sharing the user count can help show that your site is constantly growing.

## Adding the user count

To add user count functionality to WordPress, follow these steps:

1. Log in to WordPress as the administrator.

2. On the Dashboard in the left sidebar, click **Appearance**, and then click **Theme Editor**:\
   ![WordPress - Dashboard - Appearance - Theme Editor](https://static.hosting.com/kb/kb-wordpress-dashboard-appearance-theme-editor.png)

3. In the right sidebar, under **Theme Files**, click **Theme Functions (functions.php)**.

4. Copy the following code snippet and then paste it at the bottom of the *functions.php* file:

```javascript theme={null}
function display_user_count() {
    $usercount = count_users();
    $result = $usercount['total_users'];
    return $result;
}
add_shortcode('user_count', 'display_user_count');
```

5. Click **Update File**. WordPress saves the changes to the *functions.php* file.

6. User count functionality is now enabled, but you must update the post or posts where you want this information to appear. To do this, open a post or page on the site, and then type `[user_count]` where you want to display the user count. For example:\
   ![WordPress - User count example](https://static.hosting.com/kb/kb-wordpress-user-count-example.png)

Save your changes, and then view the post:\
![WordPress - User count example](https://static.hosting.com/kb/kb-wordpress-user-count-example-2.png)

## Related articles

* [Adding a custom logo to WordPress](/docs/adding-a-custom-logo-to-wordpress)

* [Installing WordPress themes](/docs/installing-wordpress-themes)

* [Managing WordPress comments](/docs/managing-wordpress-comments)

* [Scheduling post publishing in WordPress](/docs/scheduling-post-publishing-in-wordpress)

* [Using widgets in WordPress](/docs/using-widgets-in-wordpress)
