Single meta_query query using OR instead of AND in request’s WHERE statement
I believe the shortest and best approach is to (1) modify the query: function search_faqs_metadata($query) { if(!is_admin() && $query->is_main_query()) { if($query->is_search) { $query->set(‘meta_query’, array(array( ‘key’ => ‘_faqs’, ‘value’ => $query->query_vars[‘s’], ‘compare’ => ‘LIKE’ ))); } } } add_action(‘pre_get_posts’, ‘search_faqs_metadata’); and then (2) replace the AND with OR via the get_meta_sql filter: function change_meta_key_where_from_and_to_or($sql) { if(is_search()) … Read more