A simple search in codex shows there are some parameters you can set to exclude some categories for example :
<?php $args = array(
'show_option_all' => '',
'show_option_none' => '',
'orderby' => 'ID',
'order' => 'ASC',
'show_count' => 0,
'hide_empty' => 1,
'child_of' => 0,
'exclude' => '',
'echo' => 1,
'selected' => 0,
'hierarchical' => 0,
'name' => 'cat',
'id' => '',
'class' => 'postform',
'depth' => 0,
'tab_index' => 0,
'taxonomy' => 'category',
'hide_if_empty' => false
); ?>
Related Posts:
- Search is always exact [closed]
- Empty search returns home page, how to return not found search page?
- How to look at code in WordPress repositories without downloading?
- Including categories in search results
- Insert DIV container below 1st search result
- Search in WordPress – Difference of searchpage.php, searchform.php and search.php?
- How to make WordPress search prioritise page titles?
- How to add the author search in the default wordpress search?
- How to search for users based on added user metadata
- Search by Post ID and display content of the post in search result
- Exclude categories from search query
- Let user change posts per page
- Turning Broken URLs Into Search Terms?
- Create product category and keyword search form in woocommerce? [closed]
- Search uses index.php instead of search.php on renaming search field from “s”
- How to control WordPress Search Behavior?
- Changing the default WordPress search action
- Set default text for the_search_query();
- Changing the search results destination URL
- What are the different options for excluding certain post types from search results?
- Search in post title and custom fields
- How to change users smart quotes to dumb quotes in search bar?
- Searching through different categories on different pages code is not working
- Trim the search result around the search word
- Help with multiple dropdown tags search
- Searching custom fields is removing search on the post_title column
- Edit search results in order to advertise
- Date_query problems
- WordPress, fetching users with an exact match in a string of comma separated values in user_meta
- Site search needs to find posts for category topic AND Tag or keyword thats not in the post
- search form redirects to home
- How can I hide uncategorized products from search results?
- Exclude html from search results (image names, etc.)?
- documentation for wordpress 3.7 keyword
- WordPress Search not picking up text provided by a Plugin
- How to exclude pages from WP search based on page title
- What does wordpress search, search?
- How to combine two get_users() array?
- Search not working. Appending a “
- Search posts by Tag
- Change Twentyeleven Search Form Text
- redirected to the login screen when I do a blank search
- Add Google custom search to wordpress.com [closed]
- Changing default wp search string
- How do I exclude a specific page (and child pages) from the search results?
- Sort WP Search results by date
- How to pass data to wordpress page (without GET parameter)
- Check If search query contains something?
- Show search count by post type
- WP + Google analytics = /search?
- Alter BuddyPress member search to include search on added profile fields [closed]
- Enhancin 404 to contain a search from URL
- Checkboxed term search
- Search using ACF repeater
- search custom table in wp database with searchform
- How to track searches using the REST API?
- REST API: Search products only in the names
- content-search.php duplicating the output for a certain post type
- Categories In English version showing not canonical URL, instead shows query search result
- In the php, how can I have a category of a custom post type display?
- Form for search pages by meta datas
- WordPress REST API Search decoded URL with cyrillyc symbols
- Hide Search Form above results
- searchform.php not included by get_search_form when using wp_dropdown_categories
- Modify wordpress search to search only pages and load matched page not search results
- Create search box on Archive Custom post type
- Problem with search results page
- Search result page as a new page
- Search by tag, category and author without plugin
- Search Engine Visibility Issue in WordPress
- Page has no template
- Allow users to search for other users in WordPress
- A search box for all sites – Multisite
- How to stop the search results from loading the wrong template?
- search form display no result
- WordPress search not able to find text in url
- Search & Replace trailing strings
- Search in particular category in wordpress
- Page/Post path in Search Results
- Customizing Home Page with Pagelines Platform
- Search Limited to Categories Not Working
- Google Search and Own Website Search?
- How we filter the search base on post-meta tags
- Make search result returned only from tags! [duplicate]
- Search functionality with multiple categories
- Form Data Causes “Page Not Found”
- WordPress search form and input type=”image”
- Search options/filters
- How to search pdf attachment?
- Website Search Results Not Showing Images
- How to search for articles containing two words?
- Wp eCommerce meta information search [closed]
- How do I create a search form that searches only within a custom post type?
- Two Querys in one Search – Category-Tag nightmare – HOW?
- Code in the excerpt of the search page
- Display different sidebar based on search results from one category
- WordPress REST API response – not returning results from custom taxonomy, only from title
- Members location sortable based on UK Postcode
- I had removed my phone number from my website footer, but months later it still appears once I look it up on google, how to remove it?
- search posts by POST ID