I don’t see an “orderby Rand()” parameter for either get_users or WP_User_Query. There is a filter called pre_user_query that could be used but I am not sure I see the benefit of that when shuffle will randomize the array you already have.
$args = array(
'fields' => 'all_with_meta',
'exclude' => array(1),
);
$users = get_users( $args );
shuffle($users);
var_dump($users);
Related Posts:
- how to get list of all users and their metadata
- Return all users with a specific meta key
- get_users is expecting unserialized meta_value
- Getting all user metadata from user
- Wp_User_Query not sorting by meta key
- WP_User_Query with combined meta query – not working?
- Check if WP_User_Query ‘include’ is empty
- get_users / WP_User_Query returns empty when logged out
- How to get the user description with get_users?
- get current user not working
- WP User Query fails when searching meta queries and search columns
- Is a user_meta research case-sensitive or not
- Query users by capability – uninstall/deactivate callback
- Showing all users who match 2 meta fields with current user
- WP_User_Query pulling ACF to loop
- Why get_users() not working on the admin backend?
- Passing args to WP_User_Query am I using meta correctly?
- WP_User_Query not returning users with meta – what am I missing?
- How get meta from all users?
- Reduce number of SQL queries inside WP_Query loop to fetch author data
- Display the line breaks in user bio without using html
- How do I sort a WP_USER_QUERY by multiple meta fields?
- WP_User_Query not searching
- get random users each time based on the meta key
- Wrong result in fetching User meta of WordPress
- Getting user data via ajax
- Storing data to database and user registration
- How to get user meta value in wordpress
- Extend WP_User_Query or WP_User to return all custom fields?
- Sort users by custom user meta value
- Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the “users search” input box
- wp_user_meta doesn’t return data in a foreach loop
- Adding fields to the “Add New User” screen in the dashboard
- Difference between update_user_meta and update_user_option
- Get basic Image Uploader on User Profile Page
- How to create a template for a custom URI associated with the user
- How do you add a custom option to user data?
- Where to Store Custom User Fields
- Querying Email Addresses for a List of Users with Same Last Name?
- Display sortable User meta column in admin panel user’s page
- Add profile field (usermeta) to Add New User
- Allow role to edit users at lower level with only specific metadata
- Hook or action to save profile fields at specific time
- How to query users who have empty first_name?
- Does wp_delete_user() remove all user content?
- How to tell whether a user meta value has increased or decreased [closed]
- In what part of the WordPress core does the users table and usermeta table get joined?
- How to pass user meta_key and meta_value (values as array)
- Use wp_update_user to update custom column in wp_users table
- WPML Default Language User Meta [closed]
- Search Users base on meta_value & meta_key
- Parent User and Child User – relate users
- User Meta Data in a Sortable Table
- strange issue with user_meta + json_encode/decode
- Inserting and finding multiple values in user-meta fields
- Column Sorting Code on users.php
- Update user meta on logout
- How to Access wp_usermeta Data Immediately After a New User is Created
- Subscribers Group User meta delete
- get the taxonomies terms associated with users
- Redirecting users based on custom user meta
- Query posts based on the meta key values of logged-in users?
- How to activate the user search
- WordPress REST API and User meta data
- How to get the count
- Assign random (and unique) user meta upon registration
- How can I undo accidentally duplicated user metadata key values?
- How to add to a user_meta field (append)
- Custom Field Repeating When Using foreach
- Can I use paginate_links() to add a pagination list, yet prevent it from inserting links?
- If logged in user views his profile page
- Getting a users username in get_user_meta
- How to get its meta_value of a specific meta_key within wp_usermeta
- How do i put in user id in a banner
- Update user meta array using foreach
- Can’t get the user_meta correctly
- Pagination on WP_User_Query not updating current page
- Save custom field types with this function…?
- delete_user_meta from a foreach results page
- How $_GET[‘updated’] variable is passed when updating a user?
- Reading additional fields in PMPro
- How to grab data after wp user search is complete
- How can I return an error message when updating user meta?
- Export WordPress User Meta to CSV/Excel
- Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
- how to save multiple checkbox in usermeta and get it?
- Query for user roles and their skills
- update_user_meta inside a popup/modal
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Add method for tracking who referred new users
- User biographical information erased on login
- If logged in user meta is
- WP Cron: Save third party data as user meta
- Reordering fields in registration form via custom plugin
- Does WordPress Need BuddyPress to Handle Large Amounts of Users?
- Using and saving custom dropdown boxes on user profiles
- Store subscription details for users in WordPress
- How to add custom detail page for a Subscriber at Admin Panel
- Unable to do WP_User_Query with meta filter
- Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box