function wpb_search_filter($query) { if ($query->is_search && !is_admin()) { $query->set("cat", "-1370"); } return $query; } add_filter("pre_get_posts", "wpb_search_filter");