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:
- Sorting: custom query with orderby meta_value_num THEN by title
- WP_Query with checkbox meta_query
- Add indexing to meta_value in wp_postmeta
- Custom WP_Query order by post_meta and (author) user_meta
- Perform query with meta_value date
- Meta Query with date and time on the same Day before given time
- How to grab metabox value in wp_query meta_query key
- datetime picker, timestamps and meta queries
- Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
- How can I create a WP_Query that returns posts where one meta_value
- Meta Query querrying several post types based on ACF fields is broken after update to WP 4.1
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- How to count data records in wordpress which have same meta_value in wp_postmeta table?
- meta_key and meta_value not working together
- Order WP Query posts by custom order calculated from post meta values
- how to speed up a complex wp_query?
- How to query for custom field within Gutenberg block from outside of that post? [closed]
- Meta Query for specific months
- Meta query with JSON value
- Get meta info related to current post
- Creating arguments from loop for WP_Query meta_query
- Add condition of user capability in WP_query
- ACF Date Based wp_query
- How to make Meta Query case sensitive?
- Get attachment by meta_key value
- Any number in meta key (wp query)
- Using meta_query with multiple keys and compare values
- Mysql query and order meta value
- Is it a good idea to improve meta query performance by adding tax query?
- meta_query BETWEEN, but the range is stored in the custom field
- Is it possible to set specific posts to show first in a query?
- Modify wp-query and sort by post meta key
- Orderby listing issue
- Order ascending is ignored in meta query?
- Query with meta_query and tax_query together not working properly
- Array as ‘key’ in WP_Query
- Is it possible to query a custom field where the value is between two fields?
- Filter posts by comparing custom meta value against postdate
- How to provide meta_key array to wp_query?
- Searching for meta_key returns 0 posts
- meta_query fails to compare on values containing apostrophes
- How to set up hierarchical relationships without using plugins / meta query
- Check if searched number is within the post meta value
- Meta query compare for ID’s greater than specific ID
- Is it possible to add relation between meta_query and tax_query?
- add_query_arg to compare and display events from a certain date
- Show single posts date, in a page of posts
- WP_Query Class custom field parameters
- WP_Query not returning correct result with meta_query parameter
- meta_query where the meta value is not the post title
- Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
- Query on meta values and post title
- Combine query in WP_User_Query()
- How do i create a custom post query when the meta value is an array?
- Custom Meta Query doesn’t work the same on two site
- meta_query with meta values as serialize arrays
- WP Query – grouping posts by same meta key, adding together values from another key
- Woocommerce Get Orders By Meta Value
- meta_query is overriding default search
- Multiple WP_Query args combinations according to post type
- WP_Query multiple value not working
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Query for current post
- Custom query to retrieve oldest post and retrieve others with date interval
- WP_User_Query Orderby Not Working
- Unusual high query of user meta data
- Very slow query generated getting meta data from posts
- WordPress Query optimaization for slow query
- How to filter on placeholder image
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Meta query doesn’t remove placeholder escape before query
- WP Query Meta Query
- Query custom meta value – post view and date meta
- What is the best way to reset a search on a meta_key / meta_value?
- Slow query when selecting with large meta query or post__in
- How can I modify standard search query to include also ACF custom fields values?
- Custom WP_query and integrating into theme file
- WP_Query – show posts where meta value and user_email match
- WP Meta Query at depth 2
- Best way to Order Post in Home without a plugin
- WP_Query using meta_query with LIKE doesn’t return what it should
- Is there any difference between below WP_Query code snippets?
- Return a single custom post from multiple meta queries
- Sorting: custom query with orderby meta_value_num THEN by title
- query post based on comparison
- Including ‘cat’ => $cat breaks meta_query
- meta_query compare not doing what I want it to do
- 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
- 294 Queries on Mainpage of WordPress
- 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
- 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