I had the same desire. A quick and dirty answer is to use the get_meta_sql
to replace the leading 'AND'
with an 'OR'
.
(See also the answer here: https://stackoverflow.com/questions/43734845/how-to-give-or-relation-in-tax-query-and-meta-query-wordpress ( A related, but not duplicate, question.) )
Related Posts:
- Using meta query (‘meta_query’) with a search query (‘s’)
- Add custom fields to search
- Is there a way to do multiple ordering on a multiple meta_query?
- WordPress Search Custom Meta Field Only
- Ordering posts by anniversary using only day and month
- Displaying posts with only upcoming dates according their custom field date value
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- How do I use wp_query for WordPress search?
- How make a custom search on backend in WordPress without plugin?
- filtering custom post types via meta data drop down
- How to add a new meta key and assign timestamp to posts
- Custom WP_Query for WordPress Search Results with meta_query
- filter custom field values $min $max
- How can you include custom post meta in search without calling each key?
- Ordering posts by custom field named “date” in backend
- Unique meta_key with array value vs repeated meta_key with single values
- Avoiding ACF get_field and returning to core WordPress function
- change order of images attached to post
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- How to improve my non-unique metadata MySQL entries?
- searching by keywords in post’s metas or pagination links problem
- Search one custom field?
- Create custom query for search?
- Query postmeta values, and return multiple post_titles for common meta value
- WP Query Args – search by meta_key or title
- Search for meta_query does not return any result if combined with title
- Advanced search form with filters for custom taxonomies and custom fields
- Custom post meta field effect on the performance on the post
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- How to enable revisions for post meta data?
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- passing argument to get_template_part() or a better way to code
- searching in custom meta field
- Create meta boxes that don’t show in custom fields
- Calling Specific Pages with wp query Part II
- How to use pagination with get_post_meta
- Copying Custom Meta Values from existing post to a duplicate post
- Move value of one custom field to another
- How can I combine meta_query queries?
- Get a post_id where meta_value equals something in a serialized meta_value field
- How to save a ToggleControl value in a meta field?
- Including Database Generated Pages in Site Search [closed]
- MySQL query to set wp_postmeta using term_taxonomy_id value
- Order by custom field value not working for acf date field
- How to Validate Post Meta type/extension (Video File Image File etc)
- Adding Custom Fields to Search
- Custom Meta Box not Saving in Posts with Gutenberg Editor
- How can I sort homepage by a meta value?
- Meta query with timestamp using WP_query
- Bulk remove post meta
- How to create html block to display extra information on woocommerce single product page
- Create Multiple File Upload Metabox in WordPress
- Run a check for multiple meta key values
- WordPress Rest API to call page data associate with custom meta
- Hide custom meta data if empty
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- How to create a shortcode to print specific values stored in a post meta array?
- Advanced search for meta fields
- How to load an assets based on custom field value?
- How to populate custom field dropdown box based on prior selection?
- Search in Archive Pages by subcategory, tag, custom field and year
- Change order of posts
- Meta Query And/Or
- How can I do a variable for meta_query?
- Can I access a post meta field before the loop?
- wrap text around custom fields array
- ORDER BY custom field value out of where clause
- Get all the posts where meta field with multiple choice has several values checked
- Save all the post tags inside a custom field
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- Update post meta custom field using block editor
- Get custom fields without _edit_last, _edit_lock, _wp_page_template and _visual-subtitle
- Why am I getting a “Call to member function format() on a non-object” error?
- Can’t Output get_post_meta?
- Search CPT Title AND Meta
- Modify custom field from front end
- Custom Query: query by post custom meta data
- update_post_meta not working well
- Search & column order by meta value in admin
- Custom meta fields and meta keys
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to add a post’s view count into the WordPress API response
- WP meta_query args not working in function
- Can’t set custom meta fields for a post
- Very large list of options for BuddyPress profile fields
- Search fails when using the radio buttons
- Query Posts based on custom field value
- When post is updated, custom metadata in text area field is overwritten
- Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete
- Custom Field: Display only if a specific key is selected outside the loop
- Help sorting by Meta Key value
- When editing a post with a custom meta box the values aren’t displaying correctly
- Hard Define Custom Field Value
- add_post_meta insert null value into Database
- Retrieving custom field as shortcode
- How to display search query as formatted text?