You can define the exclusion of post_type
while registering for the post.
Use the below param to make this work
exclude_from_search => 'true'
For more details check the codex
Related Posts:
- Why does ‘exclude_from_search’ exclude a custom post type from WP_Query?
- AJAX search on post pages by custom post type
- How to make a WP_Query search with custom post types?
- Search multiple custom fields by using meta_query
- WP_Query ignores post_type in category view
- Search Custom Post Type with all meta attached?
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Search tags in CPTs
- Multiple post type queries (with specific arguments for each)
- Use get_post_types to query only custom posts types
- WP_Query | ‘post_type’ doesn’t work
- Including Custom Meta with posts_where query
- Including metaboxes from custom post types in global search — continued
- Advanced search form with filters for custom taxonomies
- how to get this tax_query working?
- Select2 AJAX and WP Query Returns ALL and does not filter
- find custom post type post by searching its custom field with my string
- Custom post type and standard post not displaying or working
- Searching post types
- Post Type => Any conundrum
- Change search query in wordpress custom post type
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- post_type incorrect for custom post type
- Live search by custom tag
- Create Second Search Page Only for Custom Post Type
- Conditional posts in WP_query for search
- Manually build WP_Query
- WP_Query with custom post type search showing all results every time
- Custom post type blog pagination conflict
- Customising wordpress search and using $_GET[“s”]
- Searching Custom Posts content with JQuery
- Custom post archive with search, is_search() is false?
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Query all posts where a meta key does not exist
- Development of a WordPress Search Plugin – Best Practices
- Exclude a category from WP_Query
- Single loop for wp_query and wp_user_query
- query multiple taxonomies
- Custom Post Type, WP_Query and ‘orderby’
- Include post id[s] into WP_Query()
- Grab 5 latest posts from custom post type ‘announcements’
- Pagination Doesn’t Work
- filter search result with custom post type meta key
- Numeric pagination custom post type
- Sort the main query in subcategories/terms?
- Get post info inside modal window?
- Want to filter only parent post in admin area
- Pagination Issue: Custom Post Type In Index
- Having trouble with custom date field for CPT query (WordPress)
- Quickest way to get last or oldest post date – WP Query
- multiple search forms and search results
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- CPT posts listed by category with custom rewrite URL, please help!
- How to use WP_Query in a CPT achive page?
- How can i skip same post from taxonomy term?
- Query custom post type by category slug
- WP_Query orderby modified to include custom meta changes
- Multiple meta_values in the pre_get_posts filter?
- Search / Filter posts on Title/Content OR Tags
- Several post types on WP Query by tag and taxonomy
- What to and how to proceed with CPT to make DB small and efficient?
- Auto Complete Search
- Filter Posts from the Main Query
- Remotely search WordPress sites using xml-rpc
- WordPress Custom Search by post_type
- How can I group posts by months and years?
- Display post from a date range from custom field
- Displaying a div from an assigned meta_value when on a page
- WP_Query parameter conflict
- Retrieving meta-box from a custom-post-type
- Cannot get custom post
- Display custom post type for specific user
- A faster way to query custom post types with multiple conditions?
- List all Custom Post Type posts excluding certain Taxnomy term
- WP_Query: Posts within category OR custom post type
- Add filter to Admin list for all custom post types by their custom taxonomies
- Redirecting search to specific templates with $_GET[“post_type”]
- Custom post type pagination error
- WP Query from two Custom Post type fields as statement
- Display post count for a specific month
- Query to Exclude Child Pages from Custom Post Type Archive
- WP_query has incorrect wp_posts.post_name = ‘asc’ when I have custom post type called ‘order’
- Randomizing WordPress Custom Post Type Sorting Through Them Without Page Refresh
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- How to output custom post type title on custom page with category next to it?
- How to sort by multiple values in a nested WP_Query
- search results to show individual ACF fields from inside custom posts
- How can i order my posts by post type?
- Permanent Custom Post Type
- SQL LIKE in WP_Query
- How can you use a page for a custom post type?
- WP Query with multiple post types ordered by custom meta date then published date
- Extensive search filtering and results->PDF in the front-end
- Values inside a custom field to determine which category posts to display
- WP_Query get posts where post_name is empty
- How do I sort post listing by child post count?
- Querying meta values within an array
- Searching for a single custom post type, buddypress
- Archive page – problem with pagination