please never do this: 'value' => $_GET['s'] … $query->get('s');, get_search_query, or sanitize_key($_GET['s']) are all safer options. Technically we shouldn’t be using get-params in wordpress at all, it’s not a best-practice. That get value could be all sorts of bad things, & we don’t want to pass it along to the db without making sure it’s clean.
Also, you’re using the LIKE operator… so you might want to add quotes around the value for stricter matching.
'value' => '"'.$query->get('s').'"';
Related Posts:
- Using meta query (‘meta_query’) with a search query (‘s’)
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Is there a way to do multiple ordering on a multiple meta_query?
- WordPress Search Custom Meta Field Only
- How make a custom search on backend in WordPress without plugin?
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Meta Query And/Or
- filter custom field values $min $max
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- searching by keywords in post’s metas or pagination links problem
- Create custom query for search?
- ORDER BY custom field value
- SQL Query to copy value of a meta_key into another meta_key
- How to rename a custom field?
- Matching Serialized Arrays with meta_query
- Custom search: by post data and post metadata?
- Need small coding with Custom Fields Search
- Search ONLY by meta key / meta values
- Trying to perform complex custom field query with order by set to field value
- searching in custom meta field
- Bulk move (or copy) from a custom field to the post content?
- Up/Down voting system for WordPress
- Custom Fields Bulk Edit
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Slow meta query with multi meta keys
- Using OR in WP_Query negates the “NOT EXISTS” compare
- Displaying posts with only upcoming dates according their custom field date value
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- Sorting posts by multiple values, combined
- WP_Query display next custom post from today’s date
- Extend ‘The Events Calendar’ search to include custom fields [closed]
- Include woocommerce custom field value in front-end search result
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- WP_Meta_Query causing long-running MySQL queries
- Including Database Generated Pages in Site Search [closed]
- Adding Custom Fields to Search
- sort search results by custom fields using dropdown
- Get all posts that do not have a specific custom field without using a subquery
- Using a checklist to search against metadata
- Complex WP_User_Query call fails on production server
- Custom Fields Not in Search Results
- Custom Field Create Bulk via SQL Query
- filtering custom post types via meta data drop down
- How to add a new meta key and assign timestamp to posts
- Get content from pages with same meta_key from Database
- Advanced search by two criteria – sort by location and date (ascending or descending)
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Alter main archive, to show posts with meta as last
- Meta Query returns wrong number of posts
- Search in Archive Pages by subcategory, tag, custom field and year
- Custom WP_Query for WordPress Search Results with meta_query
- Change order of posts
- Meta query with multiple custom fields for archives page ordering problem
- How to let users choose where to search for posts?
- How can you include custom post meta in search without calling each key?
- Ordering posts by custom field named “date” in backend
- Get Data From wp_sitemeta for Multisite network
- Unique meta_key with array value vs repeated meta_key with single values
- How can I do a variable for meta_query?
- Avoiding ACF get_field and returning to core WordPress function
- ORDER BY custom field value out of where clause
- comment meta_query for keys that aren’t yet set
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- change order of images attached to post
- Diamond question mark in text after migrating content
- Get emails from users by custom field SQL
- Include one custom field in search results
- Custom search SQL Query to add custom field in result
- Search Results Page – Displaying Custom Meta Fields
- tax query between operator like
- Custom field Search with Relavanssi
- How to exclude custom fields from search queries?
- How to show content of custom fields in search results?
- Is it possible to compare the current time with a custom “start” and “end date
- Change word in woocommerce product category custom field
- get posts based on non-single metadata
- Search & column order by meta value in admin
- Woocommerce products search with custom fields
- How to save multiple values with same meta_key, each value linked to another tag id
- WP Query – grouping posts by same meta key, adding together values from another key
- WP meta_query args not working in function
- Filtering posts by ACF meta query
- Very large list of options for BuddyPress profile fields
- Search fails when using the radio buttons
- Create Shortcode shows only posts with custom_field meta
- meta_query ‘compare’ => ‘!=’ not working
- Search one custom field?
- Query postmeta values, and return multiple post_titles for common meta value
- Query Custom Fields in Searchform
- Filter query based on date in custom field
- Convert all dates in field to Unix time, except those already in Unix time
- Help sorting by Meta Key value
- Checking if field is set before comparing with meta_query in query_posts?
- Update field name without losing the value
- How do delete a meta key?
- Filter Query Post by Custom Fields(by date)
- How to display search query as formatted text?
- WP Query Args – search by meta_key or title
- Search for meta_query does not return any result if combined with title