Display the total number of users of WordPress
April 29, 2009 · Print This Article
If your wordpress allow user registration, what about displaying the total number of registered users? This simple code will allow you to do it easily.
Simply paste the following code anywhere in your wordpress theme files:
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
echo $users." registered users.";
Once you saved the file and refreshed your wordpress, the total number of users will be displayed.





















Comments
Got something to say?
You must be logged in to post a comment.