On this page
What this issue is
Many sites use extra subdomains: preview., staging., dev., beta. for testing, or track., go., sgtm. for tracking and server-side tagging. Sometimes one of these answers with a full copy of your public site instead of an error or a login page.
Why it costs you leads or sales
Duplicate hostnames split signals such as links and engagement between two copies of a page. Google may show the preview URL in results instead of the real one. Visitors who land there may find old prices, broken forms, test content or missing tracking, so the lead or sale is lost or goes unmeasured.
- Search resultGoogle lists preview.example.com
- Preview copyOld content, test form, no live tracking
- Form or checkoutFails or goes to the wrong place
- Lead or saleNever reaches your inbox or CRM
The visitor lands on a copy that was never meant to be public.
How to check if your site has it
Search Google for your content on other hosts
Search
site:example.com -site:www.example.com(swap in your domain and main host). Any result on another subdomain is a candidate. Also search a distinctive sentence from your home page in quotes.List your subdomains
Open your DNS settings and note every A, AAAA and CNAME record. Look for wildcard records (
*). Certificate transparency search tools such as crt.sh also list subdomains that have had certificates issued.Open each one in a private window
If it shows your site instead of a login, an error or a redirect, it is publicly reachable.
Check the response headers and source
Run
curl -I https://preview.example.com/and look forX-Robots-Tag: noindex. View the page source for<meta name="robots" content="noindex">and for a canonical tag pointing at the main domain.Check Search Console
If you have a Domain property, the Pages report covers all subdomains. Look for URLs on hosts you do not recognise.
curl -sI https://preview.example.com/ | grep -i -E "HTTP/|x-robots-tag|location"How to fix it
Pick the option that matches what the subdomain is for. Password protection is the strongest, because it stops both crawlers and people. A noindex is a weaker fallback. Do not rely on robots.txt alone: it blocks crawling but a blocked URL can still be listed if other pages link to it, and Google cannot see a noindex on a page it is not allowed to fetch.
Decide what the subdomain is for
Needed for testing or tracking? Keep it but restrict it. Not needed? Remove it.
Send noindex on every response
Add an
X-Robots-Tag: noindex, nofollowheader at the server level for that hostname (examples below).Add a login or IP allow-list
Use HTTP basic auth, your host's password protection, or an allow-list for your team. This keeps people and crawlers out.
Remove or redirect what should not exist
If the subdomain is obsolete, delete its DNS record. If real visitors may have bookmarked it, 301 redirect each URL to the matching page on the main domain.
Point tracking subdomains at the right service
A tracking subdomain should only answer tracking requests. Do not point it at the same web root as your site, and return an error or redirect for page URLs.
Ask Google to remove already indexed URLs
In Search Console, verify the subdomain and use Removals for a temporary hide while the noindex or redirect takes effect.
Remove links to the subdomain
Search your live site, sitemaps and emails for the subdomain name and replace those links with main-domain URLs.
Hide a staging copy
On the staging site go to Settings > Reading and tick 'Discourage search engines from indexing this site'. Treat this as a fallback only, and add a login at host level as well. Make sure the setting is not copied to or from the live site when you push changes.
Check what is public
Your myshopify.com address and any unused domains can serve your store. In Settings > Domains, set your main domain as primary so others redirect to it. Preview themes are not indexed the same way, so share preview links only with your team.
Disable indexing of the webflow.io subdomain
In Site settings > SEO, turn on 'Disable Webflow subdomain indexing' and republish, so the .webflow.io copy returns noindex.
Check the free Wix address
Make sure your connected domain is set as primary in Settings > Domains so the default Wix address redirects to it. Do not publish test sites to a public domain.
Set the primary domain
In Settings > Domains, set your custom domain as primary so the built-in address redirects. Password-protect pages or the site under Settings > Site Availability while you test.
Add a header and auth at server level
Use the nginx or Apache snippet below inside the server block or virtual host for the subdomain only.
server {
server_name preview.example.com;
add_header X-Robots-Tag "noindex, nofollow" always;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
# ... your usual config
}Header set X-Robots-Tag "noindex, nofollow"Before
- preview.example.com serves a full copy of the site
- No login, no noindex
- Appears in Google next to the real pages
After
- Subdomain needs a login or is removed
- Any response carries noindex
- Only the main domain is in search results
How to confirm it's fixed
- The subdomain asks for a login, redirects, or returns an error in a private window
curl -IshowsX-Robots-Tag: noindexif the page is still reachablesite:preview.example.comshows fewer results over the following weeks- Search Console shows the duplicate URLs as excluded by noindex or not found
- No links on the live site, sitemap or emails point to the subdomain
- Your real pages are the ones shown for your key searches
How to prevent it happening again
- Put every new test or preview environment behind a login from day one
- Avoid wildcard DNS records that send unknown subdomains to your live server
- Keep a list of all subdomains and review it when you change hosts or agencies
- Add a self-referencing canonical to the main site, so copies point back to it
- Check that go-live steps do not copy the noindex setting onto the live site, or leave it off the staging site
- Verify a Domain property in Search Console so new hostnames show up
How FunnelGuard handles this
FunnelGuard does not check for this yet. Spotting a duplicate subdomain in search results is a possible future check, but today it is not part of the product.
What FunnelGuard does do is run your real customer journeys on a schedule: lead forms, checkouts, booking and chat buttons. It checks each step, the tracking hits sent to platforms such as GA4, Google Ads and Meta, and whether test leads reach your inbox and CRM. If a visitor reaching a broken copy of your site would hit a failing form or missing tracking on your live site, that kind of failure is what it is built to catch. It does not tell you that a duplicate hostname exists.
Questions people ask
Why is my staging or preview subdomain showing up in Google?
Google found a link to it or discovered it through DNS, and the server returned a normal page with no login and no noindex. Add a login and a noindex header, then remove the URLs in Search Console if needed.
Does a duplicate subdomain hurt my SEO?
It can. Two hostnames with the same content split links and signals, and Google may rank the wrong one. The effect is usually moderate, but it is easy to fix.
How do I remove a subdomain from Google search results?
Verify the subdomain in Search Console and use the Removals tool for a quick temporary hide. For a lasting fix, serve noindex, a 404/410 or a 301 redirect, and let Google recrawl the URLs.
Is robots.txt enough to keep a preview site out of Google?
No. robots.txt stops crawling but not listing, and it also stops Google from seeing a noindex tag. Use password protection or noindex instead, ideally both.
Should a tracking subdomain serve my website pages?
No. A subdomain used for tracking or server-side tagging should only answer tracking requests. If it also returns your site, restrict it or redirect page URLs to the main domain.
Can a canonical tag fix a duplicate subdomain?
It helps as a hint, because the copy can point to the main-domain page. But it is only a hint, so it does not replace a login or noindex for a preview site.
Does FunnelGuard detect duplicate subdomains?
No, not yet. It could be a future check. Today you can watch for it with Search Console and site: searches, while FunnelGuard monitors your forms, checkouts and tracking.
Related issues
- SEO-045Canonical points to the staging or development domainFix guide
- SEO-065Mirror domain or IP address serves the site with 200Fix guide
- SEO-052Google chose a different canonical than declaredFix guide
- SEO-053Both www and non-www versions resolve with 200Fix guide
- SEO-042Missing rel=canonical on indexable pagesFix guide
- SEO-043Canonical points to a 404, redirect or noindex URLFix guide