When I'm developing sites in Drupal, I create various content types and taxonomy vocabularies that I use with Views to build displays. I might not ever want the nodes to be viewable in their own right or listed by taxonomy. Visitors may never figure out the URLs to do this, but I'd still like to lock this down.

I'm aware of various content access modules, and have considered theming taxonomy displays to simply say 'page not found'. But I've yet to find a simple solution, so wondered what other people use to prevent content from being viewed outside of a View?


3 Answers 3


In D6, I set the path alias for these content types to be


and then use

function MYMODULE_init ()  
    $path = drupal_get_path_alias(request_uri());  

    if (strpos($path, "no-view/") !== FALSE) {  

I think this will work as-is in D7, but I haven't tried it.


I'd just leave that content unpublished. You can surface it through the view, but no one else can access it.


Instead of denying access to the page it would be much simpler to let the view page use the actual path you don't want found. Then you could use path_auto to make pretty urls.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.