I had a mishap when a site on my staging server was picked up by Google. I want to devise a foolproof but simple strategy to prevent this from happening again. Would password protecting the entire subdomain with htaccess prevent Google from being able to index a site?

1 Answer 1


Not really a WP question, but I do this with dev sites. I don't think I can give you an absolute answer as to search engines' behavior, but speaking from experience, adding authentication like htpasswd retroactively would cause an eventual departure from search results. Adding auth proactively has produced effective results for me. The search engine hits the auth, then is left with a 401 error.

You can also try asking Google to in-undex your stuff if you need to. The site needs to be registered in Google Websmater Tools/Search Console. https://support.google.com/webmasters/answer/1663419?hl=en

  • Thanks. I was thinking only of protective implementation.
    – pastic
    Aug 17, 2016 at 11:08
  • *proactive (typo)
    – pastic
    Aug 17, 2016 at 11:09

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.