WordPress | count_users Function

Prem Tiwari - - WordPress Functions

The count_users() function will count the number of users who have each of the user roles in your WordPress.

Below is the syntax of count_users () Function, how to use in your WordPress plugin or theme file.


Used Parameters:

$strategy :(string) (Optional) The computational strategy to use when counting the users. Accepts either ‘time’ or ‘memory’. Default value: ‘time’

$site_id : (int|null) (Optional) The site ID to count users for. Defaults to the current site. Default value: null

Below is an exaple of count_user() funtion hot to use in your code.

Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.