The Operator “NOT IN” Does Not Work In tax_query
I suspect you need an array for the terms – although I’m not sure why it would work with “IN” and not with “NOT IN”… But I’d try this: function menta_pre_get_posts( $query ) { if ( !is_admin() && $query->is_search() && $query->is_main_query() ) { $term = get_term_by(‘slug’, get_query_var(‘s’), ‘product_tag’); if ( $term && !is_wp_error( $term ) … Read more