Exclude Content Types from Search
The Exclude Content Types from Search module allows site administrators to exclude selected content types from Drupal's native search system.
The module provides a simple configuration form where administrators can select the content types that should not be indexed or displayed in native content search results.
## Features
- Excludes selected content types from Drupal's native search index.
- Prevents excluded content types from appearing in native search results.
- Removes existing index entries when the configuration is saved.
- Allows previously excluded content types to be indexed again.
- Supports multilingual content.
- Provides a dedicated administrative permission.
- Requires no additional contributed modules.
## Requirements
This module requires the following Drupal core modules:
- Node
- Search
The module only affects Drupal's native Search module. It does not integrate with Search API, Solr, Elasticsearch, or external search providers.
## Installation
Install the module as you would normally install a contributed Drupal module.
Using Drush:
`drush en exclude_content_types_search -y`
Clear Drupal's caches after installation:
`drush cr`
## Configuration
1. Navigate to Configuration > Search and metadata > Exclude content types from search.
2. Select the content types that should be excluded.
3. Save the configuration.
4. Run cron to process any pending native search indexing.
The configuration form is also available at:
`/admin/config/search/exclude-content-types`
## Permissions
The module provides the following permission:
- Administer excluded content types in native search
Only trusted administrative roles should receive this permission.
## Uninstallation
Uninstalling the module removes its configuration. Content previously excluded by the module can be indexed again during subsequent cron runs.