Title: disable post/comment search
Last modified: August 21, 2016

---

# disable post/comment search

 *  Resolved [victord34](https://wordpress.org/support/users/victord34/)
 * (@victord34)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/disable-postcomment-search/)
 * hello(sorry bad english im french)
 * i have a question.
 * how to disable the post/articles and comment in search ?
    do you have a code 
   for “function.php” to disable it ?
 * i would like.. just “pages” in search nothing else
 * thanks
 * [https://wordpress.org/plugins/search-everything/](https://wordpress.org/plugins/search-everything/)
 * _[Please don’t bump]_

Viewing 1 replies (of 1 total)

 *  [PetraP](https://wordpress.org/support/users/petrap/)
 * (@petrap)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/disable-postcomment-search/#post-5113314)
 * Hey Victor,
 * thanks for reaching out and really, really sorry for not replying any sooner.
   The thing is you found a bug in our plugin, for which we are truly grateful, 
   but until we release the next update, you will have to make the changes manually.
   So, here it goes:
    1.) go to the “Plugins”->”Editor”, select Search Everything
   plugin and in the search-everything.php file replace the lines (cca.702 – 707)
 *     ```
       if ( $this->wp_ver23 ) {
       $excludeQuery = " AND ( ctax.term_id NOT IN ( ".$excl_list." ))";
       }
       else {
       $excludeQuery = ' AND (c.category_id NOT IN ( '.$excl_list.' ))';
       }
       ```
   
 * in the **se_build_exclude_categories** function (starts at line 691) with:
 *     ```
       if ( $this->wp_ver23 ) {
       					$excludeQuery = " AND ( ctax.term_id NOT IN ( ".$excl_list." ) OR (post_type IN ('page')))";
       				}
       				else {
       					$excludeQuery = ' AND (c.category_id NOT IN ( '.$excl_list.' ) OR (post_type IN (\'page\')))';
       				}
       ```
   
 * 2.) In the plugin settings just exclude the categories you don’t want – for example,
   you can make a category “Post” and put all posts there and then exclude that 
   ID in the settings. This way, only pages will be found. You can find the ID of
   a category by hovering over on the blog. Check [the screenshot](http://i.imgur.com/m8odvSg.png)
   for easier navigation.
 * Once again, sorry for the late reply and hope this helps!
 * Take care and have a nice day,
    Petra

Viewing 1 replies (of 1 total)

The topic ‘disable post/comment search’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/search-everything_242529.svg)
 * [Search Everything](https://wordpress.org/plugins/search-everything/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-everything/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-everything/)
 * [Active Topics](https://wordpress.org/support/plugin/search-everything/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-everything/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-everything/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [PetraP](https://wordpress.org/support/users/petrap/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/disable-postcomment-search/#post-5113314)
 * Status: resolved