Removing Taxonomy Term Pages in Drupal

Last modified: 
Sunday, March 29th, 2015

There is no way to turn off the Taxonomy module's term listing pages in Drupal 5 or 6 (I haven't tried in version 7). One way to disable them is to add the following to the top of settings.php:

# Return a 410 Gone response if viewing a taxonomy term search page.
# These can be found at /taxonomy/term/123...
if (preg_match("/^taxonomy\/t/", $_GET['q'])) {
  header("HTTP/1.0 410 Gone");
  print '


'; print '

The requested page has been removed permanently.

'; die(); }

You can also redirect to a 404 page instead if you prefer.

if (preg_match("/^taxonomy\/t/", $_GET['q'])) {
  header("HTTP/1.0 404 Not Found");

The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.