You should use a total_users property:
$query = new WP_User_Query( $args );
$query->total_users;
or get_total method:
$query = new WP_User_Query( $args );
$query-> get_total();
Docs are your friend: https://codex.wordpress.org/Class_Reference/WP_User_Query
Related Posts:
- List users by last name in WP_User_Query
- Wp_User_Query not sorting by meta key
- WP_User_Query with combined meta query – not working?
- pre_user_query meta_query admin user list
- How to use search_columns in WP_User_Query?
- How to query users who have empty first_name?
- WordPress User getting added with id of 0
- WP User Query fails when searching meta queries and search columns
- Getting users by specific capability, not role
- how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard
- WP_User_Query – searching multiple fields
- Accessing current users data within a plugin
- How to activate the user search
- List Users alphabetically with heading
- is_user_logged_in() throwing undefined function error
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- Display the line breaks in user bio without using html
- User with same Mail but a different additional info(like domain)
- SQL to set Display Name to First Name + Last Name
- Cannot update newly added User field using wp_update_user
- Getting user data via ajax
- Find count of WordPress users by role and search string for user name
- Sort users by custom user meta value
- Show only users with the same role in Dashboard user list
- How to get userid at wp_logout action hook?
- How to migrate wordpress users from one blog to another
- How can I link users across multiple subdomains?
- Importing Existing Users with Passwords
- Limit amout of sessions on user-by-user basis?
- Redirect user to login before viewing custom post
- Create a front user register/login/profile & logout without interfering with wp-login.php?
- Rest API code to get ID of current user not working: get_current_user_id() gives 0
- Bulk lock users without email address?
- Add Custom Filter to Admin User list
- WordPress SQL Issue not returning correct reselts
- How to get last user with wpdb?
- How to Create a User Profile Page?
- How to default/force the user’s display_name to their nickname?
- Creating User Profiles using author.php
- “the_author_meta(‘url’)” not working inside “href”
- REST API: wp_get_current_user not working on second call
- How to let the users edit their user names?
- How do I filter users based on email address?
- What’s the correct way to add capabilites to user roles?
- Web app vs CMS backend
- User roles not displaying
- Allow admins to login as other users
- How to count total words for posts published by one author?
- Should I setup frontend-only users as CPT or use a plug-in?
- How to expire user registration?
- Delete a user from frontend
- Echo a list of all subscriber’s user IDs
- user login and its profile
- wp_delete_user – huge overhead in Buddypress?
- Get current logged-in user from external site
- Delete all users with Editor role and their content mysql
- Send user auto generated password on different email
- Random users always showing same 8 users
- Load Custom Field to User Profile as per User Role using Ajax
- Show posts who published after registration date
- How to hide “Change role to” dropdown on Users admin menu
- Get UserInfo from WordPress
- How to display a calendar with events depending on the user?
- How to show different pages for different users
- How can i display pagination in custom comment list?
- hide page menu from admin panel for specific users
- Single Sign On (SSO) between two WordPress websites
- WP_User_Query Search Multiple Keywords from a Multi-Select Field?
- Disabling user capability to edit_posts or delete_posts in the front-end
- Redirect /member/ to /member/user
- get user id in a plugin without a function
- $user_login is not working if author has only 1 post
- WP_User object behaving strangely when used inside Admin Panel?
- REST_query_vars for users
- How to use a transient inside WP_User_Query
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Showing extra profile fields in admin – problem with underscore
- Add an ‘edit profile’ page with Genesis
- Exclude Current user email and send notification
- Extend WP_User_Query or WP_User to return all custom fields?
- Insert query not working for non-logged in user
- Disallow user registration/checkout via Hotmail/Yahoo
- User management missing after migration to new host
- Add new user and user bio at same time
- How to create a link to a user’s profile page
- Validate user meta and redirect
- Let admin users edit member profiles from front end
- Storing additional information about the user
- Current User Seeing Another Logged In User Info
- What techniques can a user employ to achieve a password rated “strong” in the WordPress password checker
- New User Registration email
- Remove @gmail.com from WordPress username
- How to create a specific role to manage users
- How to track all users logged into a site?
- Export user data from Squirrly’s Starbox plugin?
- Force Profile link for username, and stop “Website” field on Profile from becoming offsite link atop Comments, in “Recent Comments” list, etc
- Will users still be able to log in if I change host?
- Is there a way to resend confirmation emails?
- Add Additional Column in “Users” Dashboard Area – BP Extended Profiles (WordPress)