Short answer: You can’t do that.
The query system is a simplified version, by design. It cannot do combinations of ANDs and ORs across keys like that.
If you want to do that, you’ll need to write your own SQL in some manner. The meta_query is not capable of that complex of a query.
Related Posts:
- Meta_query compare operator explanation
- meta_query with meta values as serialize arrays
- Nested meta_query with multiple relation keys
- meta_query ‘compare’ => ‘IN’ not working
- Use REGEXP in WP_Query meta_query key
- WP Query Args – Title or Meta Value
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- How to query posts based on lat-lng coordinate as post meta?
- how to show posts that are missing a meta_value
- Set Alias for meta_query arguments in get_posts()
- Sorting: custom query with orderby meta_value_num THEN by title
- Display products from specific category in shop page
- How to Compare Two Meta Fields
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Does tax_query really beats meta_query in all situations?
- WP_Query with checkbox meta_query
- ACF Relationship Field Search Filtering [closed]
- Add indexing to meta_value in wp_postmeta
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Custom WP_Query order by post_meta and (author) user_meta
- Query WooCommerce orders where meta data does not exist
- Getting attachments by meta value
- Query Multiple Post types each with own meta query
- Execute a large WP_Query with many “AND” Meta_Queries?
- Query all posts where meta value is empty
- WP_Query min and max values
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- WP_Query using meta_query with relation OR and orderby meta_value doesn’t work
- Using custom meta_query with relation not working as expected
- Perform query with meta_value date
- querying with custom meta field with meta_query
- Order by two meta keys
- multiple meta key but get server load is very high
- Meta Query with date and time on the same Day before given time
- A WP_Query that will look for posts after 2 weeks ago OR with a certain meta value
- How to grab metabox value in wp_query meta_query key
- WP_Query meta_query where meta value ends in space
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Is there any difference between below WP_Query code snippets?
- Get closest event where meta_key field is an array
- WP_Query with meta_value_num and meta_query not paged correctly
- Post Query not working after updating to 4.1
- Orderby Meta Value and Query from Meta Query
- Return a single custom post from multiple meta queries
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Set right order for query that returns posts based on two custom fields
- Sorting: custom query with orderby meta_value_num THEN by title
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- Passing conditional arrays to WP_Query() [closed]
- query post based on comparison
- WordPress Query Default Order if Meta Values Same?
- Sort Posts with custom meta key by default which is currently set as optional
- Meta_query weird behaviour
- Why is WP_Query’s meta_query not filtering results?
- Including ‘cat’ => $cat breaks meta_query
- meta_query compare not doing what I want it to do
- Looking for a way to exclude frontpage and nav menu from query filter
- WP_Query with several meta_query-statements and order by meta_value
- Custom query (author is post_author or meta co_author) with Pagenavi pagination
- Creating Custom Query
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- Can’t figure out query logic
- WP_Query orderby not working on custom post_type
- Wp query by 2 meta field – check if they exists / have value
- meta_query in wp_query not working as expected
- 294 Queries on Mainpage of WordPress
- Get posts by meta value except one post [closed]
- Get all user with both meta_value
- WP_Query by meta key not returning any posts
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- WordPress extremely slow when using get_posts with multiple meta_query relations
- How do I have multiple metaqueries inside one wordpress query
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- WP query with multiple custom meta not respecting orderby
- Get posts using multiple values from ACF checkbox as meta query wordpress
- WP Query – Show custom posts only if user contain some user meta
- How do I subquery with custom meta fields?
- get_post_meta bringing back results, but $wpdb->postmeta doesn’t
- Use meta query only 3 or more results?
- Showing Counts on Comment List with Custom Query
- Custom query with custom filtering returning incorrect results
- WP Query returning all posts when Meta_query is null
- Display only posts with thumbnails
- Use value from meta key array for use in WP_Query
- WordPress – Optimize the Meta Query for 3 meta keys at a time
- Passing a variable containing a comma separated list of values in a meta-query
- Complicated `orderby` based on text in custom field
- meta_query post_date not returning results
- WP Query: orderby with one meta key, but multiple values
- How to use meta_query to retrieve posts from multiple custom post type
- How to get products with the same custom attribute like ean code
- WP_Query filtering in ACF field containing dates
- Multiple meta value orderby clauses in a WP_Query
- WP_Query: how to sort all posts by date when one category has a custom “date” field?
- get_meta_sql hook is not firing
- Post Query with Meta Query no longer working
- Problem making a WPQuery with ACF boolean
- Order by multiple custom fields within woocommerce hook for catalog ordering (woocommerce_get_catalog_ordering_args)