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 contains www in the address, filtering out your main production website if it lives on the www subdomain.

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

  1. Run the base query: Enter site:yourdomain.com -inurl:www into Google Search, replacing yourdomain.com with your actual domain name.
  2. Exclude known legitimate subdomains: If you intentionally index subdomains like blog.yourdomain.com or shop.yourdomain.com, filter them out by appending -inurl:blog -inurl:shop to narrow the results.
  3. Target common staging prefixes: If the results are still noisy, search specifically for common environment names using queries like site:staging.yourdomain.com or site:dev.yourdomain.com.
  4. 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 noindex headers: Configure the server to return an X-Robots-Tag: noindex HTTP header on all non-production environments. Avoid relying solely on robots.txt to block crawling, as Google can still index a URL if external links point to it.
  • Request removal: Once the environment is protected with noindex or authentication, use the Removals tool in Google Search Console to temporarily hide the subdomain from search results while Google recrawls and drops the URLs.