Family Best Time >> Electronics

How to display the total number of registered users in WordPress

Have you ever wanted to display the total number of registered users on your WordPress site? Social proof, like displaying the number of registered users on your site, encourages others to sign up as well. In this article, we will show you how to display the total number of registered users in WordPress.

How to display the total number of registered users in WordPress

Method 1:Display the count of registered users using a WordPress plugin

The first thing you need to do is install and activate the Simple Blog Stats plugin. For more details, check out our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings »Simple blog statistics page to configure plugin settings.

How to display the total number of registered users in WordPress

This plugin allows you to display different statistics of your WordPress site. You need to click on the shortcodes tab to expand it and then scroll down to the 'Number of users' row.

How to display the total number of registered users in WordPress

You will see the shortcode [sbs_users] With two text fields on both sides. These text fields contain HTML that the plugin will add before and after the number of users.

By default, the shortcode will generate HTML like this:

 856 

If you're not sure, just copy the shortcode [sbs_users] and click the Save Settings button.

You can now add this shortcode to any WordPress post or page. You can also add it to a sidebar widget. If the shortcode doesn't work in the widget, follow the instructions in our guide on how to use shortcodes in your WordPress sidebar widget.

Method 2:Manually show the number of registered users in WordPress with code

This method requires you to add code to your WordPress site. If you haven't done this before, check out our beginner's guide on how to paste web code snippets into WordPress.

You need to add the following code to your theme's functions.php file or to a site-specific plugin.

 // Función para devolver la función de conteo de usuarios wpb_user_count () $ usercount = count_users (); $ result = $ usercount ['total_users']; devuelve $ resultado; // Crear un código corto para mostrar el conteo de usuarios add_shortcode ('user_count', 'wpb_user_count'); 

This code creates shortcode [cuenta_usuario] which you can use in your WordPress posts, pages or a sidebar widget to display the user count.

The function does not add any HTML formatting to the user's account and simply returns the number. You may want to wrap the shortcode around HTML to use CSS or basic HTML formatting. For example:

 

Unirse [cuenta_usuario] Otros usuarios que comparten tu interés:

Here is how it looked on our demo site:

How to display the total number of registered users in WordPress

Note:We added a free signup button that redirected to a custom WordPress user signup page.

That's it, we hope this article helped you learn how to display the total number of registered users in WordPress. You can also check out our guide on how to moderate new user registrations in WordPress.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.