Title: Excluding specific categories
Last modified: August 21, 2016

---

# Excluding specific categories

 *  Resolved [saurabhr](https://wordpress.org/support/users/saurabhr/)
 * (@saurabhr)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/excluding-specific-categories/)
 * Hey,
 * Is it possible to exclude specific categories from being searched when searching
   the custom meta field?
 * Thanks
 * [http://wordpress.org/extend/plugins/ajax-wp-query-search-filter/](http://wordpress.org/extend/plugins/ajax-wp-query-search-filter/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/excluding-specific-categories/#post-3934405)
 * Yes,you can use ‘ajax_wpqsf_query()’ filter to add the category you want to exclude.
 * eg.
 *     ```
       add_filter('ajax_wpqsf_query', 'exclude_search_cat');
       function exclude_search_cat($args){
          $args['category__not_in'] = array(1,2,3);//category id you want to exclude
          return $args;
       }
       ```
   
 *  [MADXXX](https://wordpress.org/support/users/madxxx/)
 * (@madxxx)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/excluding-specific-categories/#post-3934556)
 * where in the file

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Excluding specific categories’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ajax-wp-query-search-filter_ffffff.
   svg)
 * [Ajax WP Query Search Filter](https://wordpress.org/plugins/ajax-wp-query-search-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-wp-query-search-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-wp-query-search-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-wp-query-search-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-wp-query-search-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-wp-query-search-filter/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [MADXXX](https://wordpress.org/support/users/madxxx/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/excluding-specific-categories/#post-3934556)
 * Status: resolved