I think the use of meta_query is in order:
$user_query = new WP_User_Query(
array(
'meta_query'=> array(
array(
'key'=> 'birthday',
'compare' => 'NOT EXISTS'
)
)
)
);
Basically, this looks for all users where the meta key of birthday doesn’t have a value ie doesn’t exist. More info about meta queries in WP_User_Query can be found here
Related Posts:
- Getting all user metadata from user
- How to add custom query filters in WP_User_Query
- Query wp_usermeta alongside wp_users
- SQL User Query by Multiple Roles using PHP
- WP User Query get all authors with last name starting with specific letter
- Sort users by “birthday” using WP_User_Query
- Hide Administrators From User List except current user (administrator)
- How to display user order by role
- Import wp users via one click demo option
- Dynamic User Id
- Prevent author bio page from showing in search results
- Get multiple users with meta value in one query and populate WP_User class
- Reduce number of SQL queries inside WP_Query loop to fetch author data
- Display if author page is author page of current user
- Get user first name from custom endpoint
- Storing an array of objects related to each user
- Create one-use post dynamically, add to main query, do not insert post (user profile view)
- Query to get last posts from authors of blog
- Query pages created by deleted users
- Query posts by post type, author and post meta
- Random users always showing same 8 users
- Set “editor” role to existing user
- How to query 5 users in random who have published more than 10 posts
- How to query users by post count no less than 10
- Merge wp-query and get_users
- Get all wp_users sort by metakey
- Logging search queries for logged-in users
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- Show subscriber id in loop
- Query Users by post count, last 30 days and display each users post count according to post type
- Get users query makes the site loading time too big?
- Get all user with both meta_value
- Group users by meta field, with name of meta field as group title
- Meta_query compare operator explanation
- Exclude post ID from wp_query
- Custom query incorrectly returning everything [closed]
- Last post ordered by publish date using WP_Query on front page
- Query certain amount of posts from multiple dates
- Meta Query with date and time on the same Day before given time
- In loop: posts have thumbnail AND other variables
- Orderby = none not working [duplicate]
- Add inline HTML to posts published within last 24hrs
- Single page theme
- Get all post IDs from current WP_Query – not just currently visible
- How to Modify Taxonomy Archive Page with Search Parameter?
- $wpdb->insert inserting two rows in database
- Custom Post order for homepage
- WP-Admin edit.php & post.php slowdown after import of 10k users
- WP_query Date Range results not matching loop
- $wpdb select date range of posts
- Meta Query relation “AND” not working
- Add quicklink to in the Admin posts page where I can query by a meta_key
- Exclude an array
- Cutom wp_query for geolocation search, pagination not working
- Tax query AND/OR meta query [duplicate]
- Help ordering Post loop by two meta values
- Display most popular in the past two days
- WP_Query (list) posts according to author’s custom field
- get_post_meta in WP_Query
- How to alter local query, not main query [duplicate]
- WP_Query results stored in variables
- infinite loop in wp_query using simple query
- How to display the number of posts in a category using WP Query
- wp query for popular post with simple field
- Parent and child categories
- Set post number to single posts
- Specific html within wordpress loop
- How does WP generate the default $query in WP_Query based on the URL?
- Grabbing taxonomy terms and inserting them into an array
- custom page with post content using read more
- WP_Query orderby random do not repeat infinite scroll – one loop
- how to put thumbnail below category’s title?
- Woocommerce Shortcode which displays a table with product data
- JOIN filter doesn’t work in WP_Query in wp-ajax calls
- get_posts query is taking about 40 seconds to execute
- Customize the Sorting Dropdown in WooCommerce use another list or more page
- WP_Query by MAX post_id?
- Adding nofollow to all the post links in get_posts with pre_get_posts or WP_Query
- Query post by Category and custom file (ACF)
- Regarding a custom loop and output HTML tags
- Filtering ‘Featured’ posts from a batch of category IDs
- Speed up WP_query with meta comparing dates
- Meta Query if Values Don’t Exist
- Letting wordpress decide what template and page to use based on condition
- How to show all the associated posts with specific date of data metabox?
- wpdb get_results() returns only 2 rows
- Search Functionality broken by the wp 4.2 update
- Issue attempting a wp_query_posts with tags
- query inside main query order issue
- Get Child Custom Post Content on Single.php?
- meta_query in wp_query not working as expected
- How much does $wpdb->prepare(), then $wpdb->query() VS straight $wpdb->query(), can slow down the load time of whole page
- Pre_get_post on CPT archive page
- WP_Query – order with usort by custom meta
- How to get posts that have certain meta key value and order based on another meta key’s value
- How to cache wordpress get_posts query using transients?
- How do I show related posts from categories instead of tags?
- Force new posts to the top of query loop
- WP_query() Simulate Missing “NOT” relation to Reverse Results?
- WP_Query to find any published post with ID greater than given ID