This isn’t possible using WP_Query
, you can’t query the insides of structured data stored in a single post meta value.
At best you can use regular expressions, or do math/boolean comparisons, you can even do LIKE
comparisons, but these are all string operations.
If you need to query structured data such as objects or arrays, then the data needs breaking apart into multiple separate post meta values.
At the end of the day, post meta values are just strings of text as far as the database is concerned. You can cast them to a different basic data type such as a date or number, but that’s it.
Related Posts:
- WP_Query, ACF field and array
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- ACF Relationship Field Search Filtering [closed]
- Filtering a WP_Query meta_query by numeric values isn’t working
- Getting attachments by meta value
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Revolution Slider Orderby Two Custom Fields
- WordPress altering my custom query, How to fix it?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- meta_query with array as value
- Order by meta_key in custom post type doesn’t affect the query
- meta_key and meta_value not working together
- Order Posts by meta value AND published date
- If two first numbers exist in wp_meta_query value
- WP_Query meta_query >= date
- How To Fix WP Query Returns Results But Shouldn’t?
- ACF Date Based wp_query
- Custom query based on meta key – Reduce three states to two in results?
- What is the random string I am seeing when I use get_query_var?
- How to make Meta Query case sensitive?
- Any number in meta key (wp query)
- Fetch Record based on meta key dates
- Meta_query with multiple keys and multiple values
- meta_query BETWEEN, but the range is stored in the custom field
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Large AND OR query timing out
- meta_value_num not ordering all items
- WP_Query with meta_query dosen’t return results
- Query based on custom fields start and end date
- meta_compare not comparing whole integer
- filter wp_query result with custom field values
- Display posts with specific value first in query
- Get every post with value in meta key
- Custom query filter by ACF date custom field
- add_query_arg to compare and display events from a certain date
- Comparing 2 Decimal Numbers from custom fields and displaying posts
- meta_query weird behaviour, static int will work, but not user data
- Query multiple post types, but different order for each
- Order by the first array within a meta_query
- Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
- Query ACF relationship field – Comparator IN – Value array
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How do i create a custom post query when the meta value is an array?
- Query posts by post type, author and post meta
- WP Query – grouping posts by same meta key, adding together values from another key
- meta_query is overriding default search
- Trouble with serialized metadata
- Comparing Meta Field date in WPQuery using Meta_Query?
- Getting posts by custom field value
- Query against multiple locations within single custom post type post
- Pre get posts sort by meta key returns no results if meta key does not exist
- Order by Date Custom Field
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Query by meta value (add a dropdown of all values)
- Order Posts By Custom Field That is an array of objects
- Get posts meta_query by repater field
- How can I modify standard search query to include also ACF custom fields values?
- Custom WP_query and integrating into theme file
- Wrap group of wp query posts to parent div by date/year
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Compare meta key separation
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- query post based on comparison
- Query posts filter not working
- Display all custom meta field values from the database using ACF Repeater
- Get posts by meta value except one post [closed]
- Get posts using multiple values from ACF checkbox as meta query wordpress
- How do I subquery with custom meta fields?
- Best performance for use Custom Field in WP
- Use value from meta key array for use in WP_Query
- WP_Query with checkbox meta_query
- Ordering Posts Type A by Custom Fields of related Post Type B
- Query Posts depends on custom field inside repeater field using acf
- Is it a good idea to improve meta query performance by adding tax query?
- Understanding the orderby in WP_Query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Orderby listing issue
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- Make meta query treat meta_value as 1 or 0
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- WP Query Meta Value – How To Identify Specific, Unique Values?
- WP_QUERY with group by with custom fields
- Query posts using less than
- How to show list of posts with custom field value (a date) that are coming soon
- WP_Query meta compare must include ALL array values
- WP_Query – display posts by custom field and order by another
- meta query multiple values for the same key
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- Custom post types – meta_query: search lesson which starts sooner
- ACF Post Object meta-query by title not ID
- From admin edit user page query either the user_nicename or username field value of the user profile being edited or viewed
- WP_Query returns empty if meta_query has more than 7 values
- query_posts with sorting on a custom datestamp
- Passing conditional arrays to WP_Query() [closed]
- Taxonomy related query not working
- Get all user with both meta_value