Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Preview or tracking subdomain duplicating your site: fix it

SEO-064Medium impactOther toolBy FunnelGuardPublished Updated
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.

How a duplicate subdomain loses leads
  1. Search resultGoogle lists preview.example.com
  2. Preview copyOld content, test form, no live tracking
  3. Form or checkoutFails or goes to the wrong place
  4. 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

Find duplicate subdomains
  1. 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.

  2. 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.

  3. 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.

  4. Check the response headers and source

    Run curl -I https://preview.example.com/ and look for X-Robots-Tag: noindex. View the page source for <meta name="robots" content="noindex"> and for a canonical tag pointing at the main domain.

  5. Check Search Console

    If you have a Domain property, the Pages report covers all subdomains. Look for URLs on hosts you do not recognise.

Quick header checkbash
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.

Fix a duplicate subdomain
  1. Decide what the subdomain is for

    Needed for testing or tracking? Keep it but restrict it. Not needed? Remove it.

  2. Send noindex on every response

    Add an X-Robots-Tag: noindex, nofollow header at the server level for that hostname (examples below).

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Remove links to the subdomain

    Search your live site, sitemaps and emails for the subdomain name and replace those links with main-domain URLs.

Block indexing by platform
  1. 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.

nginx: noindex plus basic auth for a preview subdomainnginx
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
}
Apache: noindex header (needs mod_headers)htaccess
Header set X-Robots-Tag "noindex, nofollow"
Preview subdomain before and after

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

Confirmation checklist
  • The subdomain asks for a login, redirects, or returns an error in a private window
  • curl -I shows X-Robots-Tag: noindex if the page is still reachable
  • site:preview.example.com shows 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

Prevention habits
  • 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.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.