Insights › Technical SEO
Canonical tags: the rules that actually matter
A canonical tag tells Google which URL is the real one when a page is reachable at several addresses. Get it wrong and you split your ranking signals or deindex the wrong page. Here are the seven rules, and how generated apps break them.
Aug 8, 2026 · 6 min read
The same page is almost always reachable at more than one URL: with and without www, with a trailing slash, with ?ref= tracking parameters, over http and https. To a search engine those are different pages with identical content, and it has to guess which one to rank. A canonical tag removes the guess.
<link rel="canonical" href="https://yourapp.com/pricing">What it does
The canonical tag names the one URL that should be indexed. Google consolidates the ranking signals from every duplicate onto that URL, and shows it in results. Get it right and link equity concentrates; get it wrong and it scatters, or points Google at the wrong page.
The seven rules
- Every indexable page has one. A page with no canonical leaves the choice to Google. A page with two canonical tags is ignored — it picks neither.
- Point it at itself. On a normal page the canonical should be that page's own clean URL. This is the single most common omission in generated apps.
- Use an absolute URL.
https://yourapp.com/pricing, not/pricing. A relative canonical is resolved against the current URL, which defeats the purpose when the page is served at a variant address. - Match your sitemap. The canonical URL and the URL you list in
sitemap.xmlmust be byte-for-byte the same — same protocol, same host, same trailing-slash choice. - Never canonicalize to a redirect or a `noindex` page. That tells Google to index a page you've told it to drop, so it distrusts the signal entirely.
- Keep it consistent with your redirects. If you 301
wwwto the bare domain, the canonical must use the bare domain too. Contradicting signals get ignored. - Don't canonicalize paginated or filtered pages to page one. Page 2 of a list is its own page; canonicalizing it to page 1 hides its content from the index.
How generated apps break it
A single-page app injects <head> tags with JavaScript after load. If the canonical is added client-side, the crawler's first pass — which reads the raw HTML — sees no canonical at all. And because SPAs swap routes without a full page load, a stale canonical from the previous route can persist, so every page claims to be the homepage.
| Mistake | What Google does | Fix |
|---|---|---|
| No canonical on any page | Guesses; may index a parameterized duplicate | Add a self-referencing canonical per route |
Relative href (/pricing) | Resolves against the wrong variant URL | Use the absolute https URL |
| Same canonical on every route (SPA leak) | Indexes only the homepage | Update the tag on each route change |
| Canonical ≠ sitemap URL | Treats them as competing pages | Make both identical |
How to verify
- 1
Read the raw HTML
View Page Source (not Inspect) and search for
rel="canonical". If it's absent there but present in the rendered DOM, it's being added too late for the crawler's first pass. - 2
Check a few variant URLs
Load the page with
?ref=testand a trailing slash. The canonical should be the same clean URL on all of them. - 3
Cross-check the sitemap
Confirm the canonical URL matches the entry in sitemap.xml exactly, including protocol and trailing slash.
One caveat
A canonical is a hint, not a command. Google usually honors it, but if your internal links, sitemap and redirects all point somewhere else, it will trust the majority signal over the tag. Keep them aligned.
Keep reading
Why your Lovable app isn't showing up on Google
A Lovable app renders in the browser, so it looks live — but Google and ChatGPT often see a blank page. Here's what they actually receive, how to check it in 30 seconds, and the five fixes in the order that matters.
llms.txt: how to get your app cited by ChatGPT and Perplexity
AI assistants recommend products in their answers. llms.txt is one of the levers that decides whether yours is one of them. Here's what the file is, what to put in it, and the other three things that matter more than most people admit.