There’s no easy way to search serialized values in a meta query. If the list of values isn’t crazy long, potentially you could set up multiple meta queries:
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'system_power_supply',
'value' => 'single',
'compare' => 'LIKE',
),
array(
'key' => 'system_power_supply',
'value' => 'redundant',
'compare' => 'LIKE',
)
)
Or if you wanted to get super fancy, you could set it up dynamically:
$values_to_search = array('single', 'redundant');
$meta_query = array('relation' => 'OR');
foreach ($values_to_search as $value) {
$meta_query[] = array(
'key' => 'system_power_supply',
'value' => $value,
'compare' => 'LIKE',
);
}
Related Posts:
- meta_query with meta values as serialize arrays
- Use REGEXP in WP_Query meta_query key
- How to query posts based on lat-lng coordinate as post meta?
- Set Alias for meta_query arguments in get_posts()
- How to Compare Two Meta Fields
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Getting attachments by meta value
- WP_Query meta_query where meta value ends in space
- What is an efficient way to query based on post_meta?
- WP_Query not working as expected for attachments and custom meta_query
- How do I create my own nested meta_query using posts_where / posts_join?
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Order By Multiple Meta Fields
- Advanced WP Query hogs the SQL server
- Order posts by meta value and Date
- Query sticky posts with thumbnails
- How to get user_id from wordpress database inside ajax function?
- WP_Query with multiple meta fields filter?
- How to combine meta_query and post__in in WP_Query
- How to orderby meta_value_num with dollar ($) sign
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- Single meta_query query using OR instead of AND in request’s WHERE statement
- Meta Query Array Error 500
- How to do meta_query for attachments?
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Why isn’t my `meta_query` array functioning properly?
- Overwrite YoastSEO meta-tags with another page’s [closed]
- How to orderby multiple meta fields if some fields are empty
- Fetch Record based on meta key dates
- Order by meta value (numeric value lower to higher)
- Large AND OR query timing out
- WP_Query with different postmeta filter for each categories
- meta_query not working as expected
- Slow WP_Query with ‘OR’ on meta_query
- How to filter a query by multiple meta keys and order by other meta keys
- Query posts with “non set” meta value
- Ordering a mysql style datetime stamp with meta_query
- Meta Query doesn’t works as espected
- Wp_query with 2 meta keys and array of meta values
- Advanced WP_Query with meta_query, orderby?
- meta_query: check if number exists
- Event with multiple dates, display events chronologically
- Issues with search after added meta_query
- Display posts with specific value first in query
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- How to create dynamic value in WP_Query meta_query
- query post by author gender
- How do I add an item to the WP admin menu?
- Multiple meta query from array
- WP Query / Meta Query [duplicate]
- Query posts by searching for a string in a meta field
- WP_Query with 4 post meta field arguments gives 500 internal server error
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Query multiple post types, but different order for each
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- Combine query in WP_User_Query()
- Multiple nested meta queries
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Custom meta_query order for Elementor based on post meta key [closed]
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- How can I modify the query by adding to the existing query?
- ElasticPress is (aparently) messing with my search filters
- Meta query ignores multiple values of the key
- Multiple meta_query not returning rows
- WordPress Query custom ordering by temporary variable
- Comparing Meta Field date in WPQuery using Meta_Query?
- Get unique post by meta value using wp_query
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Query against multiple locations within single custom post type post
- WP_Query, ACF field and array
- Order by Date Custom Field
- Filtering WP_Query based on wp_postmeta keys values
- WP Query. Ordering posts by another post types meta
- Complex Meta Query
- Multiple meta_query not working
- compare for multiple meta values for same key in wp_query
- datetime picker, timestamps and meta queries
- WP_Query with meta_query won’t orderby
- meta_query only check if both value are set
- Get posts meta_query by repater field
- Query 3 meta_key and orderby
- wp_query sorting – one specific meta_key value at last and then sort by create date
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- meta_query not working with the_content()
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Get closest event where meta_key field is an array
- Set right order for query that returns posts based on two custom fields
- Meta_query weird behaviour
- Looking for a way to exclude frontpage and nav menu from query filter
- Creating Custom Query
- Get posts by meta value except one post [closed]
- WP_Query by meta key not returning any posts
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- Get posts using multiple values from ACF checkbox as meta query wordpress
- get_post_meta bringing back results, but $wpdb->postmeta doesn’t
- Custom query with custom filtering returning incorrect results
- WP Query returning all posts when Meta_query is null