Drupal 7 hide content type from search results

In Drupal 7 hiding content type from search results in your application is pretty simple. Hook node access alter will provide the interface to bypass the search result query.

Hide content-type

For example if there is a content type called “some_type” in your application, which you don’t want to show in your search result when you search for nodes in Drupal 7. ┬áTo hide “some_type” content type you can write a hook in your custom module as below,

If you enable your custom module from admin/drush then the search result from your Drupal application will hide “some_type” from your search result.

If you are a Drupal developer following the above trick will help you to hide the content-type, if you are not a drupal developer you can get configurable module from your admin end and you can configure which content type to hide from search results

Leave a Comment

Your email address will not be published. Required fields are marked *