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
- 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
- Problem making a WPQuery with ACF boolean
- Display posts in correct month order using single date custom field
- Order by multiple custom fields within woocommerce hook for catalog ordering (woocommerce_get_catalog_ordering_args)
- Check if searched number is within the post meta value
- Meta query compare for ID’s greater than specific ID
- Appending to existing WP_Query’s meta_query if exists
- WP ForLoop to compare meta information of posts to determine what post to display
- WP_query shortcode inside acf Repeater breaks the repeater loop
- WordPress – Optimize the Meta Query for 3 meta keys at a time
- WP_Query not using relation key as expected and not producing any results
- Passing a variable containing a comma separated list of values in a meta-query
- Complicated `orderby` based on text in custom field
- Sort wp_query of two post types using meta datefield for one and date for the other – possible?
- Meta query with ACF relationship field
- meta_query post_date not returning results
- WP Query: orderby with one meta key, but multiple values
- 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?
- Include custom post type that matches taxonomy field in another custom post type
- Use Custom Field to Display Post Loop
- get_meta_sql hook is not firing
- WP_query with ajax filter not working with input fields
- Post Query with Meta Query no longer working