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.
- Outcome
- Every page pointing search engines at the domain you actually own
- Time
- About 20 minutes
- Cost
- Free
- Level
- Intermediate
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.
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.
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.
| Surface | What it does | What it was declaring |
|---|---|---|
| Canonical tag | Names the authoritative version of a page | The platform URL |
| og:url and og:image | What gets shown when someone shares a link | The platform URL |
| Structured data | Tells AI and search what this business is | The platform URL |
| robots.txt | Names the preferred host and sitemap location | The platform URL |
| sitemap.xml | Lists every page for crawling | The 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.
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.
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.
How do you check your own site in five minutes?
All five, on your live domain, not a preview link.
- 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.
- 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.
- 03Visit yoursite.com/robots.txt and yoursite.com/sitemap.xml and read the URLs in them. Same domain, every time.
- 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.
- 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/.
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.
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.
Go view-source on your homepage and search for “canonical”. It takes thirty seconds, and it’s better to know.
Get Unstuck