Core methods
Password Protecting a Site to Get It Out of Google
Putting a site behind authentication is the right choice whenever the content should not be public. It is not an instant delisting method, though, and the details of how you build the wall matter.
Why authentication is the strongest option
Google's removal documentation lists password protection as the way to keep Googlebot and other crawlers out while letting intended users view the page. Unlike noindex, it also protects the content from anyone without credentials and from crawlers that ignore indexing rules. That is why it is the default for staging, development and private client work.
What happens to pages already indexed
An access wall does not erase existing listings on its own. Google must recrawl the URL, receive the 401 or 403 (or a redirect to a login), and then process it. Google's HTTP documentation treats 4xx responses other than 429 the same: it does not use content from them and the indexing pipeline removes previously indexed URLs. No timeframe is given. To hide listings quickly, pair the wall with a temporary removal.
Kinds of access control
| Method | Returns | Notes |
|---|---|---|
| HTTP basic authentication | 401 | Simple, covers every path and file at the server level |
| Identity-aware proxy or SSO gateway | 302 to login or 401 | Strong, but check the login page's own indexability |
| IP allow-list | 403 or connection refused | Good for internal tools |
| Application login on specific routes | Varies | Risk of leaving some routes public |
| Hosting platform password feature | Varies | Check it covers assets and API routes |
Prefer a wall at the edge or web server, since application-level protection often misses assets, feeds, sitemaps and API endpoints.
A caution about 401 and 403 elsewhere
Google's documentation advises against using 401 or 403 to limit crawl rate on a site that should remain indexed. That advice is about crawl management. For content that should be hidden, an authentication wall is the intended mechanism, and the removal guide recommends it.
Step-by-step
- Decide which hostnames and paths are covered. Include every alias, see alternate hostnames.
- Enable authentication at the server or edge.
- Test with an unauthenticated request:
curl -sI https://example.com/should return 401 or a redirect to login. Test a deep URL, a PDF, an image,/robots.txtand/sitemap.xml. - Verify the property in Search Console by DNS so that verification does not depend on a file behind the wall.
- File a prefix removal for the hostname.
- Monitor the Pages report for URLs moving to a blocked-unauthorized category.
- After several weeks, run
site:checks.
Decide about robots.txt and the login page
If the wall returns 401 for everything, including /robots.txt, Google may not be able to fetch the robots file. Google's robots documentation describes how unreachable robots.txt affects crawling behaviour. A common compromise is to leave /robots.txt accessible and permissive. Also make sure a custom login page is not itself indexed as a content page; add X-Robots-Tag: noindex to it.
When to prefer noindex plus auth
If you need Google to see an explicit noindex first, deploy noindex, wait for pages to drop, then add the wall. That sequence is slower to protect the content and faster to delist, so use it only when the content is not sensitive. Otherwise, wall first. Our method comparison explains the trade-off.
Gaps people leave open
- Uploads or media on a separate CDN hostname
- A public API that returns the same content as JSON
- RSS feeds and sitemap files
- Old backups such as
.zipor.sqlfiles in web-accessible folders - Admin routes that were assumed private
- Preview URLs created by the build pipeline
Visitors and teammates
Share credentials through a password manager, and consider SSO rather than a shared password. For client previews, time-limited tokens are better than a permanent shared login. Make sure uptime monitors and legitimate integrations are given access, or their checks will fail and trigger alerts.
Reversal
To make the site public again, remove the wall and deploy production-safe signals (no noindex). Expect Google to take time to recrawl and reindex, as covered in recovery after a mistake.
Example: a client preview that leaked
A design studio shared a preview link with a client; the client posted it in a public forum and the preview appeared in search. The studio put HTTP authentication in front of the preview, gave the client a new credential, filed a prefix removal for the hostname, and confirmed with curl that unauthenticated requests returned 401. They also rotated the preview hostname so the old link was dead. Within a couple of weeks the listings cleared. The extra rotation step mattered more than the removal tool, because the leaked address could not be used again.
Credential hygiene
| Practice | Why |
|---|---|
| Unique credential per client or project | A leak is contained |
| Expiry date on previews | Old links stop working |
| Password manager for sharing | Avoids pasting in chat |
Testing the wall from outside
Test from a network and browser profile that has never logged in. Check the homepage, a deep URL, a media file, the sitemap and any API route. Also test the http:// version and any alternate hostname, because walls are often applied to the primary hostname only. A single unprotected alias is enough to keep a site visible.
Frequently asked questions
Does password protection remove a site from Google immediately?
No. Existing listings clear after Google recrawls and receives the error. Use the Removals tool to hide them sooner.
Is robots.txt access needed behind a wall?
It is not required for the wall to work, but leaving robots.txt reachable avoids confusion in crawl behaviour.
Can Googlebot ever read protected content?
Not without credentials. That is why it cannot see a noindex on a walled page.
What about content already cached elsewhere?
Authentication does not remove copies held by third parties. That requires their own processes.
Official sources
Keep reading
- Pillar: How to Deindex a Website From Google and Bing: The Complete Guide
- Noindex vs Password Protection vs 410: Which Method Should You Use?
- How to Deindex a Staging or Dev Site That Got Indexed
- Site-Wide Noindex: How to Apply It to an Entire Website
- Removing a Whole Site With the Search Console Removals Tool