Custom filter for main search: how to exclude specific post_type from search results
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