Why Google is indexing the wrong domain for your site

Search your business name and find yoursite.vercel.app instead of your real domain? That’s not a stale index. Your site is asking for it.

Londynn Metten

· 7 min read

You’ll end up with

Every page pointing search engines at the domain you actually own

Time
About 20 minutes
Cost
Free
Level
Intermediate

The short answer

If searching your business name returns your site under a hosting platform URL like yoursite.vercel.app instead of your real domain, the usual cause isn’t a stale index. It’s that your live site is actively telling search engines that the platform URL is the real one, through its canonical tag, social tags, structured data, robots file and sitemap. It happens when the site builds its own address from the deployment environment instead of from a value you pinned. Fixing it is one constant, and checking it takes five minutes.

01

What does this look like when it happens to you?

You search your own business name. The right site comes up. The URL underneath it is something like yourbusiness-abc123.vercel.app, or a netlify.app address, or a staging subdomain you forgot existed.

It’s easy to shrug at. The site works, people can find it, and the assumption is that Google just needs time to catch up to your real domain. That assumption is what lets it run for weeks. It belongs to the same family as a contact form that silently drops leads: nothing looks broken, so nobody looks.

Search engines aren’t confused. They’re following instructions your site is giving them.

02

How does one line break six things?

On a client site in August 2026, we traced it to a single file whose job was to answer one question: what is this site’s address? It answered by reading the deployment environment, which is the hosting platform telling the app what URL it’s currently running on.

In production, that resolved to the platform’s own URL rather than the custom domain. And because every part of the app asked that one file, every part of the app got the same wrong answer.

SurfaceWhat it doesWhat it was declaring
Canonical tagNames the authoritative version of a pageThe platform URL
og:url and og:imageWhat gets shown when someone shares a linkThe platform URL
Structured dataTells AI and search what this business isThe platform URL
robots.txtNames the preferred host and sitemap locationThe platform URL
sitemap.xmlLists every page for crawlingThe platform URL

The structured data one is the quiet damage. Search results recover. Answer engines resolving your business entity to a hosting URL is a longer road back, because that association gets reused every time something asks about you.

The custom domain had been connected about ten days earlier. So it ran wrong for ten days, on a site that looked completely fine the entire time.

03

Why does building the URL automatically seem like a good idea?

Because it works, right up until it doesn’t. Deriving the address from the environment means preview builds get correct links to themselves, nobody has to remember to update a constant, and the hosting platform’s own documentation often nudges you toward it.

It fails at exactly one moment: production, on the real domain, which is the only moment that counts for search. And it fails silently, because a page that declares the wrong canonical renders identically to one that declares the right one.

Pin the production host as a constant. Preview builds then declare production as canonical instead of competing with it, which is what you wanted anyway.

04

What’s the second version of this bug?

We hit a subtler one on our own site while building this library, on 2026-08-10.

Nothing was derived from the environment here. The problem was that the address was written down in more than one place, and one of them disagreed. Our case study pages declared the non-www version of the domain, while the robots file, the sitemap and every other page declared the www version.

Same category of failure. Different symptom. In the first case the site had one source of truth and it was wrong. In the second it had several, and they’d drifted. Both end with your pages pointing at a host you didn’t intend, and neither shows up as anything visibly broken.

05

How do you check your own site in five minutes?

All five, on your live domain, not a preview link.

  1. 01Open your homepage, right-click, View Page Source, and search the text for “canonical”. The URL you find should be exactly the domain you want ranking.
  2. 02Do the same on a deeper page, a service page or a blog post. This is where mismatches hide, because deeper pages often get built later by someone else.
  3. 03Visit yoursite.com/robots.txt and yoursite.com/sitemap.xml and read the URLs in them. Same domain, every time.
  4. 04Check www against non-www. Pick one as the real one, and make sure every canonical, the robots file and the sitemap all agree with that choice.
  5. 05Search a distinctive exact phrase from your homepage in quotes, and look at which URL comes back.

Character for character. https://site.com and https://www.site.com are two different sites as far as a search engine is concerned, and so are /page and /page/.

06

What does the fix actually look like?

Write the production domain down once, as a fixed value, and have everything read from it. In the client case that was a single line, and it corrected all six surfaces at once because they all asked the same file.

Keep an override available for the day the domain genuinely changes, so nobody has to hunt through the code to rebrand. And on each page, point the canonical at that page’s own address, which also protects you from tracking parameters being treated as separate pages.

Then do the part everyone skips. Go fix the README and the code comments. On that client site, both documented deriving-from-the-deployment as intentional behavior. Leave that in place and the next person restores the bug on purpose, believing they’re following the convention.

Last, verify on the live domain rather than in your editor. Load the real page, view source, and read the value back. We check six things: canonical, og:url, og:image, structured data, robots and sitemap.

07

What fixing this won’t do

It won’t un-index the wrong URL overnight. Search engines re-crawl on their own schedule, and it can take days to weeks for the right domain to take over. Submitting the page for indexing helps. Patience is still required.

A canonical tag is also a strong hint, not a command. If your site is reachable at several addresses, back the hint up with real redirects so there’s only one place to land. Your apex should redirect to your www, or the reverse, and it should be a permanent redirect.

And if you’re on a hosted website builder, this particular bug mostly isn’t yours to have, because the platform owns those tags. Worth doing step one anyway. It takes thirty seconds and occasionally surprises people.

Common questions

What is a canonical tag, in plain terms?
It’s a line in your page’s code that says “if you find this content at several addresses, this one is the real one.” Search engines use it to decide which URL to show and which one earns the credit for your content.
Does it actually hurt to have the platform URL indexed?
Yes, in three ways. Your links and shares point at an address you don’t own, so you can’t redirect or rebrand it later. Any ranking you build accrues to that address. And if you ever move hosts, everything pointing at it breaks at once.
Should I use www or not?
Genuinely doesn’t matter for ranking. What matters is picking one and being consistent everywhere: canonicals, robots, sitemap, structured data, and a permanent redirect from the one you didn’t pick.
How did nobody notice for ten days?
Because nothing looked broken. The site loaded on the right domain, every page worked, and the wrong address only appeared in the parts of the page a human never reads. It surfaced when someone searched the business name and looked closely at the result.
How often should I check this?
Any time you connect a domain, launch a redesign, or move hosts. Those are the three moments this breaks, and all three are moments when everyone is looking at how the site appears rather than at what it’s declaring.

Keep going

More you can build yourself

Fix what broke

Why scroll animations hide content from some visitors

About 15 minutesAdvanced

Fix what broke

How to tell if your contact form is silently dropping leads

About 30 minutesBeginner

Build it yourself

How to run your AI assistant in the terminal, where it can see your actual files

20 minutes to set upIntermediate

Build it yourself

How to turn a workflow you keep repeating into an AI skill that fires on its own

About 1 hourIntermediate

Playbook · Part 13

How to set up Supabase for your business

About 20–30 minutesBeginner

Playbook · Part 12

How to set up Cloudflare for your business

About 20–30 minutesBeginner

Playbook · Part 11

How to set up GitHub for your business

About 20–30 minutesBeginner

Playbook · Part 10

How to set up Google Analytics your business controls

About an hour + checksBeginner

Playbook · Part 9

How to set up Bing Webmaster Tools for your business

About 30–60 minutesBeginner

Playbook · Part 8

How to set up Search Console under business control

About 30–60 minutesBeginner

Playbook · Part 7

How to set up Meta accounts your business controls

About an hour + checksBeginner

Playbook · Part 6

How to claim and manage your Bing business listing

About an hour + checksBeginner

Playbook · Part 5

How to claim and control your Google Business Profile

About an hour + checksBeginner

Playbook · Part 4

How to set up business email on your own domain

Allow a few hours; migrations take longerBeginner

Playbook · Part 3

How to register a domain your business controls

About 30–45 minutesBeginner

Playbook · Part 2

How to set up a password manager for your business

About 45–60 minutesBeginner

Playbook · Part 1

Should your business own its technology accounts?

About 20 minutesBeginner

Playbook · Part 5

How to edit your website with Claude, ChatGPT or Grok, with prompts you can copy

10 minutes an editBeginner

Playbook · Part 4

How to deploy your Next.js site from GitHub to Cloudflare or Vercel, step by step

About 45 minutesBeginner

Playbook · Part 3

How to edit your own Next.js website without breaking it

15 minutes a changeBeginner

Playbook · Part 2

What are Git and GitHub, and why does your website need them?

About 30 minutesBeginner

Playbook · Part 1

How to leave WordPress for a site you actually own

1 to 3 daysBeginner

Build it yourself

How to write one prompt that gets a usable answer on the first try

About 10 minutesBeginner

Build it yourself

How to get on Google Maps, then actually get reviews

About 1 hourBeginner

Build it yourself

How to build a brand kit you can actually reuse

About 2 hoursBeginner

Build it yourself

How to ship a one-page website with Claude, v0, and GitHub in 90 minutes

About 90 minutesBeginner

Go view-source on your homepage and search for “canonical”. It takes thirty seconds, and it’s better to know.

Get Unstuck