In short
A well-managed staging site is closed to search engines: password, Disallow: / in robots.txt, noindex as a tag or header, the CMS's “discourage indexing” checkbox, a “coming soon” page. On switchover day, all these protections must disappear from the live site, and from the live site only. Once the task is done, every public page returns 200 without authentication and without noindex, and robots.txt allows the intended crawling; the staging site, for its part, stays closed.
Why it matters
This is the most frequent and most costly migration incident: the new site goes live with the staging settings. Google points this out in its documentation on site moves: remove any noindex or robots.txt blocks that were only needed during the migration.
Each block works differently:
- Authentication (
401) or firewall (403): crawlers see no content. Disallow: /: Google stops crawling the pages; those already known can stay in the index without a description, new URLs are not discovered, and redirects from the old URLs to them are not followed through to the content.noindex(tag orX-Robots-Tagheader): crawled pages are removed from the index.- Maintenance mode (prolonged
503or a holding page returning200): Google ends up treating the pages as unavailable, or indexes the holding page.
Generative engines are affected by the same blocks: OpenAI's, Anthropic's and Perplexity's crawlers respect robots.txt and read nothing behind a password. A forgotten block therefore cuts off both search rankings and visibility in AI answers, at the very moment the old URLs start redirecting to the new site.
What it improves
- Indexing The new URLs can be crawled and indexed from the switchover onwards.
- Carrying rankings over The redirects from the old URLs lead to indexable pages, which allows signals to be transferred.
- AI citations The assistants' search crawlers can access the content.
- Timing A block detected within the hour costs almost nothing; detected after a week, it can cost weeks of traffic.
How to check
From a computer outside the company network (the office IP address is often allowed on staging):
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/
curl -sI https://example.com/ | grep -i -E "^(x-robots-tag|www-authenticate|retry-after):"
curl -s https://example.com/ | grep -i -o '<meta[^>]*name="robots"[^>]*>'
curl -s https://example.com/robots.txt
Correct result: 200, no x-robots-tag line containing noindex, no www-authenticate, no noindex tag, and no User-agent: * group followed by Disallow: /.
In Search Console, the URL Inspection tool, with “Test live URL”, should show that crawling and indexing are allowed. In Bing Webmaster Tools, URL Inspection does the same check.
How to implement
Before you start
Before the switchover, list the protections set up on the staging site, along with where each one is configured. During protecting and auditing the staging site (opens in a new tab), they have often been stacked at several levels:
| Protection | Where to look | Check |
|---|---|---|
| HTTP password | Virtual host, .htaccess, control panel, platform |
401 code |
| IP address list, firewall, Zero Trust access | Server, CDN, WAF | 403 code or login page |
Disallow: / |
Physical or generated robots.txt |
Reading the file |
noindex |
Theme tag, SEO plugin, CMS setting | Source code |
X-Robots-Tag: noindex |
Server configuration, CDN, middleware | Headers |
| Holding or maintenance page | Plugin, CMS mode, server rule | Page content |
Golden rule: make each protection depend on the environment (APP_ENV variable, staging hostname) rather than removing it by hand on launch day. Staging then stays closed and production open, with no intervention.
After each removal, clear the caches: page cache, CDN, caching plugin. A page cached with noindex can be served for hours after the fix.
Apache
Versions Apache 2.4.
Look for inherited directives in the configuration and in .htaccess files:
grep -rn -i -E "AuthType|Require ip|X-Robots-Tag|RewriteRule.*maintenance" /etc/apache2/sites-enabled/ /var/www/example/ --include="*.conf" --include=".htaccess"
If production and staging share the same .htaccess, make the protection conditional on the hostname instead of removing it:
<If "%{HTTP_HOST} == 'staging.example.com'">
AuthType Basic
AuthName "Preproduction"
AuthUserFile /etc/apache2/.htpasswd-staging
Require valid-user
Header always set X-Robots-Tag "noindex, nofollow"
</If>
Reload with sudo apachectl configtest && sudo systemctl reload apache2.
Nginx
Versions Nginx 1.24 and later.
sudo nginx -T 2>/dev/null | grep -n -i -E "auth_basic|allow |deny |x-robots-tag|return 503"
In the production server block, there must be no auth_basic, no deny all and no add_header X-Robots-Tag "noindex…" left. Keep them only in the server block whose server_name is the staging one. Reload with sudo nginx -t && sudo systemctl reload nginx.
Cloudflare
Versions Cloudflare dashboard, all plans, November 2026.
Review three places:
- Security rules: in security rules, disable the rules created during acceptance testing that block or challenge all traffic outside an IP address list.
- Cloudflare Access (Zero Trust): an Access application set on
example.comforces everyone to log in, crawlers included. Restrict it to the staging hostname. - Transform Rules and Workers: in the Rules overview, look for an
X-Robots-Tagheader added to responses.
Then purge the cache: Caching > Configuration, “Purge Everything”. If you filter AI crawlers, also check that the settings match your policy; see check CDN, Cloudflare and WAF (opens in a new tab).
AWS
Versions AWS console, November 2026.
- CloudFront: a CloudFront Function or Lambda@Edge function for Basic authentication associated with the default behavior must be disassociated from the production distribution. A response headers policy can also add
X-Robots-Tag: check the one attached to the behavior. Create a/*invalidation after the change. - Amplify Hosting: under
Hosting > Access control, remove password protection from the production branch. - Application Load Balancer: delete the authentication action (Cognito or OIDC) from the listener rule for the public host.
Plesk
Versions Plesk Obsidian 18.0.
Websites & Domains > example.com > Password-Protected Directories: remove the protection on /. Then review Apache & nginx Settings, in the additional directives fields, looking for X-Robots-Tag or auth_basic. If the site is a WordPress site cloned with WP Toolkit, check on the site's card that the option hiding the site from search engines is turned off.
cPanel
Versions cPanel, Jupiter theme, November 2026.
Files > Directory Privacy: disable protection on the public_html folder (or the domain's folder). Then open public_html/.htaccess in File Manager, with hidden files shown, and delete the inherited AuthType, Require and X-Robots-Tag lines.
Shared hosting
Same method as cPanel: the control panel's password protection, then the root .htaccess. Some hosts offer a “site under construction” or “maintenance mode” option in their customer area: turn it off. Then test from an outside network, because your own IP address may be exempt.
Vercel
Versions Vercel platform, all plans, November 2026.
Vercel does not add noindex to the production domain. Check in Settings > Deployment Protection that protection does not apply to the production domain (an option extended to all deployments would close it), then look for an X-Robots-Tag header in vercel.json and in the framework configuration. Test the custom domain, not the .vercel.app URL.
Netlify
Versions Netlify, all plans, November 2026.
In Project configuration > General > Visitor access, check that password protection does not cover production. Look for X-Robots-Tag in the _headers file and in netlify.toml, especially under [context.production].
WordPress
Versions WordPress 6.4 and later.
Settings > Reading: untick “Discourage search engines from indexing this site”. From the command line:
wp option get blog_public
wp option update blog_public 1
The value 1 allows indexing; 0 adds noindex, nofollow to the whole site.
- Deactivate the maintenance or coming-soon plugin (SeedProd, Maintenance, the host's maintenance mode).
- Review the
robots.txt: a physical file at the root, copied from staging, replaces the one generated by WordPress or the SEO plugin. - In Yoast SEO or Rank Math, check that no content types are set to
noindex. - Clear the cache of the caching plugin and of the host.
To prevent a repeat, set the per-environment behaviour in the staging site's wp-config.php with define( 'WP_ENVIRONMENT_TYPE', 'staging' ); and never copy this file to production.
Shopify
Versions Shopify admin, all plans, November 2026.
A store being prepared is password-protected. To open it: on the admin's Online Store page, click the access menu labelled “Private”, select “Public”, then “Update” (or “Launch store” the first time). On a trial plan, Shopify first asks you to complete a prerequisite step. Then check that the theme's robots.txt.liquid template contains no block added during development.
Wix
Versions Wix Editor and Wix Studio, November 2026.
Check that the site is published and connected to the domain, then, in the dashboard's SEO settings, that search engines are allowed to index the site. Also check the pages one by one: each page's indexing option must be turned on.
Squarespace
Versions Squarespace 7.1, November 2026.
In the site settings, site availability must be “Public”, not password-protected or private. In the settings of each important page, SEO tab, the option that hides the page from search engines must be turned off.
Webflow
Versions Webflow, all site plans, November 2026.
In the site settings, check that site password protection is not active on the custom domain. The option that disables indexing of the webflow.io subdomain can stay on: it only concerns that subdomain. Finally, look for a noindex in the custom <head> code of the site and of the pages, and in the custom robots.txt in the SEO tab, then republish.
Laravel
Versions Laravel 11 to 13.
Blocks are often set by a middleware or by the layout view. Check the actual environment and the state of maintenance mode:
php artisan about --only=environment
php artisan up
grep -rn -i "x-robots-tag\|noindex" app/ resources/views/ public/robots.txt
php artisan down returns 503 to everyone: php artisan up lifts it. Make the directives conditional on the environment rather than on a manual setting:
if (! app()->isProduction()) {
$response->headers->set('X-Robots-Tag', 'noindex, nofollow');
}
Next.js
Versions Next.js 15 and 16 (App Router).
Look for robots: { index: false } in layout metadata and for a Disallow: / in app/robots.ts or public/robots.txt. Write these files based on an explicit environment variable:
// app/robots.ts
import type { MetadataRoute } from 'next';
export default function robots(): MetadataRoute.Robots {
if (process.env.APP_ENV !== 'production') {
return { rules: { userAgent: '*', disallow: '/' } };
}
return {
rules: { userAgent: '*', allow: '/', disallow: ['/api/', '/compte/'] },
sitemap: 'https://example.com/sitemap.xml',
};
}
Check that APP_ENV=production is actually set in the host's production environment variables, then redeploy.
After removal: check and notify Google
- Run the commands from the “How to check” section again on the homepage and on one page of each template (category, product page, article).
- In Search Console, robots.txt report, request a recrawl of the file if it has changed.
- In the Removals report, check that no temporary removal request targets the new domain or a public URL prefix, for example a request made to hide the staging site with the wrong prefix.
- Request indexing of the homepage and the main pages with the URL Inspection tool.
- Add a test to the deployment pipeline that fails if production returns
noindexorDisallow: /: see remove accidental noindex tags (opens in a new tab).
Common mistakes
- Testing from the office: the company IP address is often allowed; the site looks open while crawlers receive
403. - Removing the
noindexbut not theDisallow: /: Google cannot crawl the pages to see that thenoindexis gone. - Replacing the password with a
Disallow: /“until we finish”: the new URLs are not crawled while the old ones redirect to them. - Opening the staging site too: by removing the protections in a shared file, the staging site becomes public and indexable. Make them conditional on the host or the environment.
- Forgetting the cache: the CDN and page cache keep serving the version with
noindex. - Leaving a maintenance mode that returns
200: the holding page is indexed instead of the content.
Frequently asked questions
How long does Google take to index a site after a noindex is removed?
Google only notices the removal when it crawls each page again, which can take anywhere from a few days to several weeks depending on the size of the site and how often it is crawled. Speed things up by requesting indexing of the main pages with the Search Console URL Inspection tool, submitting the sitemap and checking that robots.txt no longer prevents crawling.
Should the password stay on the staging site after launch?
Yes, keep the staging site closed by authentication for as long as it exists. It contains a copy of the site that would duplicate production if it were indexed, and sometimes test data. Best practice is to make the protection conditional on the hostname or the environment, so that the live site is open and the staging site closed without any manual intervention at each deployment.
Disallow or noindex: which one blocks indexing?
Both block, but in different ways. Disallow in robots.txt prevents crawling: Google does not read the page, but a known URL can stay indexed without a description. Noindex prevents indexing, provided Google can crawl the page to read it. At launch, you need to remove both, starting by checking robots.txt.
How can you tell whether Googlebot sees the site the way a visitor does?
Use the Search Console URL Inspection tool with the live test: it requests the page with Googlebot from Google's infrastructure, outside your network, and shows the HTTP status code, the indexing directives and the rendering. It is the most reliable way to detect IP-based protection or a firewall rule that your own tests cannot see.
Resources
- Google Search Central: Site moves with URL changesdevelopers.google.com
- Google Search Central: Block search indexing with noindexdevelopers.google.com
- Google: robots.txt specificationdevelopers.google.com
- Search Console Help: URL Inspection toolsupport.google.com
- Search Console Help: Removals toolsupport.google.com
- Shopify: Password pagehelp.shopify.com
- Vercel: Deployment Protectionvercel.com
Updated on
Topic checklist (PDF)