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
- SQL query based on two different custom field values
- Can I exclude a post by meta key using pre_get_posts function?
- Advanced search form with filters for custom taxonomies and custom fields
- Custom post meta field effect on the performance on the post
- How to get custom post meta using REST API
- Difference between meta keys with _ and without _ [duplicate]
- Orderby meta_value only returns posts that have existing meta_key
- What is the index [0] for on post meta fields?
- What is “meta_input” parameter in wp_insert_post() used for?
- How to enable revisions for post meta data?
- The “_encloseme” Meta-Key Conundrum
- ORDER BY custom field value
- Best way to programmatically remove a category/term from a post
- Using get_post_meta with new_to_publish
- Can I query custom meta data through WP_Query
- Including custom fields in search?
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Matching Serialized Arrays with meta_query
- Custom field metabox not showing in back-end
- How do I Paginate Search Results for Custom Post Types?
- Meta Query with AND & OR?
- So much data in postmeta
- Custom search: by post data and post metadata?
- Can I count the number of users matching a value in a multiple value key?
- Need small coding with Custom Fields Search
- Getting attachments by meta value
- When using add_post_meta and update_post_meta, is there any way to give the individual arrays keys?
- How to hide meta box values from custom fields list?
- Auto sort the wp-admin post list by a meta key
- get_post_meta() unserialize issue – returns boolean(false)
- What is the advantage of the wp_options design pattern?
- Search ONLY by meta key / meta values
- Storing meta fields multiple times OR once with multi dimensional array?
- Allow user to create instances of custom field
- display specific custom fields
- How Can I save multiple records in same meta key?
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- Filter results with custom field values and dropdown
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- Add custom field (value) to search result (without plugin)
- passing argument to get_template_part() or a better way to code
- Is it possible to store arrays in a custom field?
- Get updated meta data after save_post hook
- Multiple meta values for same meta_key adding on “Preview Changes” hit but not on saving or updating post
- Save HTML formatted data to post meta using add_post_meta()
- Trying to perform complex custom field query with order by set to field value
- Search everything (posts, pages, tags, cpt, meta)
- importing data from non-wordpress mysql db
- searching in custom meta field
- Create meta boxes that don’t show in custom fields
- Transients vs CRON +Custom Fields: Caching Data Per Post
- Unable to save datetime custom meta field using update_post_meta() function
- Up/Down voting system for WordPress
- post meta data clearing on autosave
- Create custom field on post draft or publish?
- Display info from custom fields in all images’ HTML
- Compare meta_query decimals not working right
- WordPress altering my custom query, How to fix it?
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Exclude custom post type from search by custom field value?
- get_post_meta fields don’t show up on posts page
- Update meta values with AJAX
- How to break meta values into different items and avoid duplicates?
- copy attachments to another post type and change attachment url
- Cannot edit post meta fields with rest API
- ajax delete value from custom field array
- Save attachment custom fields on front end
- Slow meta query with multi meta keys
- How to use pagination with get_post_meta
- Copying Custom Meta Values from existing post to a duplicate post
- Using OR in WP_Query negates the “NOT EXISTS” compare
- Add a post meta key and value only if it does not exist on the post