Staging site indexed by Google: how to find it and remove it
A staging site gets indexed when Google can reach it: no password, no noindex, and at least one link or sitemap pointing to it. To fix a staging site indexed by Google, put it behind HTTP authentication, send a noindex while the URLs drop out, and use the Removals tool in Search Console if you need them hidden quickly.
Staging copies leak in ordinary ways. Someone shares a link in a public ticket, a plugin pings a sitemap, the staging host turns up in a third-party tool that publishes URLs. Once Googlebot finds one page it follows the internal links, and a full copy of the client's site can appear under staging.example.com or dev.example.com.
How do you know your staging site is indexed?
The quickest check is a site: search on the staging host. Search site:staging.example.com and see whether Google returns pages. To find hosts you don't know about, try site:example.com -site:www.example.com, which lists indexed pages on every subdomain except the main one.
site: results are approximate, so confirm in Search Console. A Domain property covers every subdomain: open the Performance report, add a Page filter with "URLs containing" set to the staging host, and you will see whether staging URLs collect impressions. URL Inspection only works on URLs inside a property you own, so with URL-prefix properties you have to verify the staging host separately.
Sometimes the client spots it first. They search their brand and one result points to an address nobody recognises. Staging pages can rank for exact queries because their content is identical to production.
Why robots.txt alone does not fix it
A Disallow: / rule in the staging robots.txt stops crawling, not indexing. Google can keep URLs it already knows, shown without a description, and can still index new ones it finds through links. A blocked page also can never show Googlebot its noindex, because Google doesn't fetch the page to read it: a Disallow on top of a noindex cancels the noindex. Our guide on how to check robots.txt covers the file in more detail.
How to remove a staging site from Google
Order matters here. Work through these steps:
- Put the whole staging host behind HTTP authentication, with Basic auth in the server config or the password protection your host provides. Googlebot gets a 401, sees no content, and the URLs drop out as they are recrawled. This is the real fix, because it also keeps out people and other bots.
- If authentication isn't possible, send
noindexon every response. The cleanest way is theX-Robots-Tagheader at server level, which also covers PDFs and images. A<meta name="robots" content="noindex">tag in the template works for HTML pages. Leaverobots.txtopen so Google can read the directive. - For urgent cases, verify the staging host in Search Console and use the Removals tool. Google describes it as temporary: it hides URLs from results for about six months and doesn't take them out of the index, so step 1 or 2 is still needed.
- Point the canonical tags on staging to the matching production URLs only as a backup. A canonical is a hint Google can ignore.
The opposite mistake: the staging noindex goes live
The costlier problem usually happens on launch day. Staging was correctly blocked, then files or the database were copied to production with the block still inside. On WordPress the setting is the "Discourage search engines from indexing this site" checkbox under Settings > Reading, which adds a robots meta tag with noindex to every page. It is stored in the database, so it travels with a database migration and the new site goes live invisible to Google.
The same happens with an X-Robots-Tag header set in an .htaccess or nginx file copied from staging, or with a staging robots.txt deployed along with the code. None of it shows when you browse the site. The guide to catching a noindex in production explains the checks to run after every deploy.
After any launch, run curl -I https://www.example.com/ and look for X-Robots-Tag, view the source of a few templates for noindex, and open /robots.txt on the live domain.
Keeping staging and production in check
The two problems need different routines. Staging needs a site: search now and then until it is password protected. Production needs a check every time something is deployed, because the block arrives with a release.
Deltio covers the production side. Its SEO scanner reads noindex in the meta robots tag and in the X-Robots-Tag header on each monitored URL and compares consecutive scans, and it alerts you when robots.txt appears, disappears or changes, with the lines added and removed. If a launch carries the staging block along, you get an email or a Slack message instead of finding out from Search Console. Starter is £24 a month, or £20 billed annually, with a 14-day free trial.
Frequently asked questions
- Does an indexed staging site cause a duplicate content penalty?
- Google doesn't apply a penalty for duplicate content of this kind. The real risk is that Google picks a staging URL as the version to show for some queries, which splits signals and sends visitors to an unfinished site. Removing staging from the index solves it.
- How long do staging pages take to disappear from Google?
- Pages behind a password or with noindex drop out when Googlebot recrawls them, which can take from a few days to several weeks depending on how often the host is crawled. The Removals tool in Search Console hides them from results in the meantime.
- Can I restrict staging by IP address instead of a password?
- Yes. An IP allowlist keeps Googlebot out just as well, since it receives an error instead of the content. It is less practical when clients review the site from home or mobile networks, which is why a shared password is the more common choice.
- Is the WordPress "Discourage search engines" setting enough on staging?
- It adds a noindex that Google respects, but anyone with the link can still open the site and other crawlers may ignore it. It is also easy to carry into production with the database. Password protection is the safer option for staging.
- Do I need to verify the staging subdomain in Search Console?
- Only if you use URL-prefix properties. A Domain property, verified with a DNS TXT record, already includes every subdomain, so staging URLs appear in its reports and can be submitted to the Removals tool.