How to set the canonical tag on a vibe coded site
Your tool's subdomain and your own domain can serve the same pages. Pick one address with a redirect and a canonical tag, then check which one Google chose.

You connected your own domain weeks ago. Then you search for your business and Google shows the address the tool gave you, the one ending in lovable.app or vercel.app. Your links, your shares and your sign-ups all point at the domain you paid for, and Google is crediting another address.
This happens when two addresses serve the same page and nobody has told Google which one is yours. The fix is small and you can make it without going to a developer: one redirect from the tool's address, one canonical tag on each page, and a check that Google agreed. This post walks through all three, for a site built in Lovable and for one you deploy on Vercel.
Why two addresses serve the same page
Every vibe coded site starts on its tool's own address. A Lovable project lives at your-app.lovable.app. A site you deploy on Vercel gets your-project.vercel.app. When you connect your own domain, the first address does not always go away.
Lovable's custom domain guide says plainly: "You can't remove the your-app.lovable.app project URL from your project."
Vercel's docs describe the same case: "If both your-project.vercel.app and your custom domain serve the same production pages, choose the custom domain as the preferred URL." The next line is the reason it matters: "Duplicate URLs don't automatically incur a search penalty, but they can split signals and make search engines choose a different canonical URL."
That last word is the one to learn. In Google's words, "a canonical URL is the URL of a page that Google chose as the most representative from a set of duplicate pages." Google chooses. You can only send signals. The canonical URL entry in our glossary has the short version.
Check which address Google picked
Run these four checks before you change anything. They tell you whether you have the problem at all.
Is the tool's address competing with yours?
- Not done yet: A site: search for each address
- Not done yet: URL Inspection on one page of your domain
- Not done yet: A curl request to the tool's address
- Not done yet: The canonical tag in each page's source
1. Search each address. Type site:your-app.lovable.app into Google, then site:yourdomain.com. If pages show up under the tool's address, Google has indexed it.
Treat the count as a rough sign, not a total. Google's own page on the operator says it "doesn't necessarily return all the URLs that are indexed under the prefix specified in the query."
2. Inspect one page in Search Console. Open URL Inspection and paste a page from your domain.
The result shows two lines that settle the question. "User-declared canonical" is what your page asks for: "If your page explicitly declares a canonical URL, it will be shown here." "Google-selected canonical" is what Google decided: "The page that Google selected as the canonical (authoritative) URL when it found similar pages on your site." When the second line names the tool's address, you have the problem this post fixes.
3. Ask the tool's address what it does. In a terminal:
curl -I https://your-app.lovable.app/pricingA good answer is a 301 or a 308, with a Location line that names the same page on your domain. A 200 means the tool's address is still serving its own copy of the page.
4. Read the canonical tag. Open a page on your domain, view its source, and search for canonical. You want exactly one line like the one below, with https:// and your own domain in it.
On a site whose pages are built in the browser, view source shows what the server sends before your code runs. A canonical tag your code adds later will not be in it. Our client-side rendering entry explains the difference, and the Vite and React SEO guide shows what that file holds.
Pick one address and redirect the other
The strongest fix is to send every visit on the tool's address to the same page on your domain. People with old links land in the right place, and so does Google.
On Lovable: set a primary domain
Lovable handles this through a primary domain. Its guide says: "If a domain is primary, the project's other connected domains and its lovable.app address redirect to it." It also says which kind of redirect: "Lovable uses a 301 permanent redirect for page visits." A form submission gets a 307 instead, so the data it carries survives the move.
To set it, open More, then Domains, then the menu next to your domain, and choose Set as primary. Lovable's guide says that for domains added after October 29, 2025, the first custom domain you buy or connect becomes primary on its own. If someone on your team chose Unset as primary, every connected domain serves the project equally again, which is the case this post is about.
Lovable's guide adds one more step for a domain bought somewhere else: keep "Redirect www.yourdomain.com → yourdomain.com" turned on when you connect the root domain, so the www address does not become a third copy.
Lovable's SEO guide gives the order in one line: "Use a custom domain, set it as the primary domain, and verify it in Google Search Console." Its custom domain guide also suggests running Lovable's SEO review once the domain is active, and running it again if you change the primary domain.
On Vercel: one rule in vercel.json
Vercel's docs give a rule that redirects only the production vercel.app address and keeps the rest of the path:
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"redirects": [
{
"source": "/:path*",
"has": [{ "type": "host", "value": "your-project\\.vercel\\.app" }],
"destination": "https://www.example.com/:path*",
"permanent": true
}
]
}Replace both addresses with yours. The docs explain why the rule names the exact host: "Matching the exact source hostname avoids redirecting the destination back to itself or redirecting every preview URL." With permanent: true, Vercel answers with a 308. A redirect you add from the Firewall screen is a temporary 307, so use the file for this one.
For www and the bare domain, Vercel's docs point to the Domains section of your project's settings instead. Our 301 redirect entry and the guide to 301 redirects after a site move cover redirect rules on other hosts.
Set the canonical tag on every page
The redirect handles the tool's address. The canonical tag handles every other duplicate, such as the same page with ?ref=newsletter on the end.
Google's example of the tag:
<link rel="canonical" href="https://example.com/dresses/green-dresses" />Four rules keep it working:
- Each page names itself. The pricing page's canonical is your pricing page, on your domain.
- Use the full address. Google's guide says: "Use absolute paths rather than relative paths with the
rel="canonical"linkelement." - Never point every page at the home page. Vercel's docs say "Don't point every page at the homepage." Lovable's SEO review lists "Canonical URLs point to the homepage" as a problem it reports.
- Leave robots.txt out of it. Google's guide says: "Don't use the robots.txt file for canonicalization purposes."
On a Next.js site, set it with alternates in a page's metadata. The Next.js docs show this input and output:
export const metadata = {
alternates: {
canonical: 'https://nextjs.org',
},
}<link rel="canonical" href="https://nextjs.org" />The same docs say metadataBase lets you write /pricing instead of the full address, once your root layout sets it to your domain. Set it to your own domain, not the tool's.
Check how this site tells search engines which address is the real one. Report first, and change nothing until I say yes. 1. List every place that sets a canonical link: a <link rel="canonical"> tag, Next.js alternates.canonical, or a head helper. Name the file and line. 2. For each route, say what canonical URL it sends. Flag any that is relative, uses http://, names a lovable.app or vercel.app address, or points at the home page from another page. 3. If metadataBase is set, what address does it use? 4. Does sitemap.xml list pages on my own domain, or on another address? 5. Is there a vercel.json, netlify.toml or _redirects file? Does it redirect the tool's address to my domain? My domain is: [your domain]. Propose the smallest change for each problem.
Paste it in your tool, opened in your site's repository.
A canonical tag is a signal, not an order
Google weighs several signals and picks. Its guide on duplicate URLs ranks them:
Google's canonical signals
| How Google describes it | What it also does | |
|---|---|---|
| A redirect | A strong signal that the target of the redirect should become canonical | Sends people with old links to your domain |
| A canonical tag | A strong signal that the specified URL should become canonical | Nothing for visitors: both pages stay open |
| A sitemap listing | A weak signal that helps the URLs that are included in a sitemap become canonical | Tells Google which pages you care about |
So send all three the same way. The redirect and the tag both name your domain. Your sitemap lists only addresses on your domain, and the sitemap.xml guide shows how to build one on a React or Vite site.
Then wait. Lovable's guide says "Search engines pick up a change to the primary domain only when they crawl your site again." Run URL Inspection again after that and read the Google-selected canonical line.
How Vunora checks canonical links
Vunora's SEO checklist has a check called "Canonical links are valid". Its rule, as the app states it: "Each page names a usable canonical URL". It runs after each import and each publish, every Monday morning, and whenever you choose Run checklist.
It reads two places. One is the canonical saved on each page and post in Vunora. The other is the canonical tag in the HTML your server sends, on up to 50 pages of your live site.
What the Canonical links are valid check reports
| What it means | What to do | |
|---|---|---|
| No canonical URL | The page in Vunora names none | Add one in the page's SEO tab, or in your code |
| No canonical on the live site | The HTML your server sends has no canonical tag | Add the tag in your page head |
| Not a usable URL, or Live canonical is not a usable URL | The address starts with http:// or is not an address at all | Use the full https:// address of the page |
| Live canonical has no https: | The tag starts with // instead of https:// | Write the full https:// address |
| 2 canonical tags on the live site | The live page sends two or more canonical tags | Keep one, in one place in your code |
The fix is by hand. In Vunora, open a page, then its SEO tab, then Search appearance, where the Canonical URL box sits beside the title and description. What that box can change depends on where your page's head is set:
- Pages your team adds in Vunora. The canonical comes from the Canonical URL box.
- A page whose code reads its head from Vunora. The box edits what the page sends.
- A Vite page that shares index.html. The box is locked, and the app says why: "This site does not read a canonical URL from Vunora. Its head is set in its index.html, which every page shares, so Vunora cannot set one for this page." Change it in your code, or paste the prompt above into your coding tool.
The import guide explains how Vunora reads a Next.js, Vite or TanStack Start site from its GitHub repository.
Where this stops
- The check does not compare the canonical with your domain. A page whose canonical names the tool's address with
https://passes. Read the Google-selected canonical in URL Inspection for that. - Vunora does not change your host's domain settings. Setting the primary domain in Lovable, or the redirect in
vercel.json, is yours to do. - Vunora never hosts your site. A change it makes lands in your GitHub repository as a commit or a pull request.
- Google picks the canonical. No tool can make it choose your address. A redirect, a tag and a sitemap that agree give it every reason to.
Questions
Will Google penalize my site for duplicate content?
Google's canonicalization guide says "Some duplicate content on a site is normal and it's not a violation of" its spam policies. The cost is the one Vercel names: split signals, and Google choosing an address you did not want.
Should every page's canonical point to my home page?
No. Each page names its own address. A canonical that sends every page to the home page tells Google your other pages are copies of it.
Do I still need a canonical tag if the tool's address redirects?
Yes. The redirect covers one duplicate. The same page can still be reached with a tracking code or a filter on the end, and the tag tells Google which version you mean.
Can I delete the lovable.app address?
No. Lovable's guide says you can't remove it. Once your domain is primary, the lovable.app address sends page visits to your domain with a 301.
How long until Google shows my domain instead?
There is no fixed time. Google has to crawl the pages again and see the redirect and the tag. Read the Google-selected canonical in URL Inspection again after a few weeks.
Sources
- Google Search Central, what is canonicalization, read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/canonicalization
- Google Search Central, how to specify a canonical URL, read December 1, 2026: https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
- Google Search Central, the site: search operator, read December 1, 2026: https://developers.google.com/search/docs/monitor-debug/search-operators/all-search-site
- Search Console Help, URL Inspection tool, read December 1, 2026: https://support.google.com/webmasters/answer/9012289
- Lovable, set up a custom domain, read December 1, 2026: https://docs.lovable.dev/features/custom-domain
- Lovable, SEO and AI search guide, read December 1, 2026: https://docs.lovable.dev/tips-tricks/seo-geo
- Vercel, redirects (choose a canonical production domain), read December 1, 2026: https://vercel.com/docs/routing/redirects
- Next.js, generateMetadata, read December 1, 2026: https://nextjs.org/docs/app/api-reference/functions/generate-metadata
Terms in this post
New posts by email
One email when a post goes up, about editing and publishing a vibe coded site.


