I have two requirements for my site

  1. I don't want my site to be indexed by search engines
  2. Anonymous users should not be able to see any content of the site

I would have been satisfied with ip restriction in the .htaccess file but I cannot use that because this site is part of a multisite setup and as far as I know one cannot use .htaccess files in sites/mysite1/.htaccess and I don't want to go down the symlink route at the moment.

Right now I am using:

  • Shield (for Apache authentication and to prevent non content elements from being previewed)
  • Metatag (<meta name="robots" content="noarchive, nofollow, noindex, noodp, nosnippet" />

but thinking about it some more I thought that perhaps just using the Shield module wil prevent my site being indexed. Or even just disabling the View published content permissions?

So my questions are:

  1. Will the Shield module prevent my site from being indexed?
  2. Will disabling the View published content permissions prevent my site from being indexed? (with the downside that part of the site can be previewed)
  • A search engine is just another anonymous user, so yes, removing all permissions from the anonymous user role should achieve what you're looking for
    – Clive
    Dec 5, 2013 at 11:36
  • Sorry, but your question, as pretty much all 2-part questions, is too broad. First part, indexing prevention, is Drupal independent and should be rather asked on Webmasters unless you know the technique you want to use and ask for Drupal implementation. Second part requires some more details, like who is to be considered anonymous and how are they supposed to log in if they can't see anything. But first thing first, these 2 should be asked separately.
    – Mołot
    Dec 5, 2013 at 11:37
  • @Molot Understand your argument and while in doubt I decided to ask them because of their close relation like Gisle Hannemyr mentioned.
    – devunder
    Dec 5, 2013 at 13:14

1 Answer 1


Question 1: Shield will deny access to anyone that doesn't know the credentials, including robots. Using this module should be suffiscient for the use case you describe.

As long as you use Shield, metatags doesn't matter. If you do not use Shield, the metatag you list will prevent your site to be indexed by polite search engines (such as Google - read about Google's policy here). It will have no effect on some other (impolite) search engines (such as Baidu).

Question 2: Disabling "View published content" for the anonymous user role will prevent any content on the site from being indexed. Your site itself, and the placeholder string that is shown to the anonymous user when viewing published content is disabled ("No content has been created yet.") is still visible and may be indexed by search engines.

Your Answer

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

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