How to Find Indexed Staging Subdomains in Google?
Webmasters can use the search operator combination site:yourdomain.com -inurl:www in Google Search to quickly uncover non-production subdomains that have been accidentally indexed. By excluding the primary www subdomain, this query isolates staging, development, testing, and other secondary subdomains that may be leaking into search results. Running this audit helps prevent duplicate content issues, protect sensitive pre-release features, and maintain clean search engine visibility.
Understanding the Search Operators
The audit relies on two standard Google Search operators working together:
site:yourdomain.com: Restricts results to all indexed URLs belonging to your root domain and any of its subdomains.-inurl:www: Excludes any URL that containswwwin the address, filtering out your main production website if it lives on thewwwsubdomain.
When combined, Google returns only indexed pages from other
subdomains—such as staging.yourdomain.com,
dev.yourdomain.com, test.yourdomain.com, or
beta.yourdomain.com—as well as any root domain
(yourdomain.com) URLs if your site does not use
www.
Step-by-Step Audit Process
- Run the base query: Enter
site:yourdomain.com -inurl:wwwinto Google Search, replacingyourdomain.comwith your actual domain name. - Exclude known legitimate subdomains: If you
intentionally index subdomains like
blog.yourdomain.comorshop.yourdomain.com, filter them out by appending-inurl:blog -inurl:shopto narrow the results. - Target common staging prefixes: If the results are
still noisy, search specifically for common environment names using
queries like
site:staging.yourdomain.comorsite:dev.yourdomain.com. - Review the indexed URLs: Check the returned titles, snippets, and URLs to identify whether development environments, QA portals, or old test sites are exposed.
What to Do If Staging Subdomains Are Indexed
If the audit reveals accidentally indexed subdomains, take immediate steps to remove them and prevent future crawling:
- Add authentication: Place staging and development environments behind HTTP Basic Authentication or VPN access so search engine bots cannot reach them.
- Use
noindexheaders: Configure the server to return anX-Robots-Tag: noindexHTTP header on all non-production environments. Avoid relying solely onrobots.txtto block crawling, as Google can still index a URL if external links point to it. - Request removal: Once the environment is protected
with
noindexor authentication, use the Removals tool in Google Search Console to temporarily hide the subdomain from search results while Google recrawls and drops the URLs.