No canonical tag, and Google picks your page for you.

The canonical tag tells Google which URL is the preferred one for each page. It is a strong signal, not a command, and many AI-built sites skip it or get it wrong. One command checks yours.

By @ignapradosSEO and AI3 min read

The same page can load with and without www, over http and https, or with tracking parameters on the end. To a visitor it is one page. To a search engine it is several addresses with the same content.

The rel=canonical tag exists to say which one you want shown. Site generators rarely add it on their own, and when they do it sometimes points somewhere it should not.

What Google says the canonical is

Google's documentation on duplicate URLs calls it a strong signal that the URL you name should become the canonical one. Strong, not binding: Google says it may pick a different page even when you designate one, based on content quality or technical signals.

The same page ranks the signals from strongest to weakest: a redirect, then rel=canonical, then being in the sitemap. Say nothing and Google decides which version to show.

How to write it, and the mistakes that void it

It goes inside <head>, with the full address, and each page should carry one pointing at itself:

  • A canonical link in the <body> is not accepted: it only counts in the <head>.
  • Relative URLs work, but Google does not recommend them. Use the absolute one, with https.
  • Do not use a fragment (#something): Google generally does not support them.
  • Do not mix the HTML tag with the Link HTTP header: using both is more error prone, since they can name different URLs.
  • A tag carrying hreflang, lang, media or type is ignored as a canonical: for languages, use rel=alternate.
<link rel="canonical" href="https://yoursite.com/pricing" />

The mistakes the documentation flags:

Sites that JavaScript draws in the browser

If your site is built in the browser (Lovable with Vite, Bolt and similar), Google recommends putting the canonical in the source HTML and making sure JavaScript does not change it. If you cannot put it there, leave it out of the source and set it only with JavaScript, but never both.

If the server sends no real content at all, the problem comes earlier: read about HTML that arrives empty and fix that first.

Check it in a minute

Ask each important route for its HTML and read the canonical the server sends. Swap in your own paths:

for r in / /pricing /contact; do
  echo "$r"
  curl -s "https://yoursite.com$r" | grep -io '<link[^>]*canonical[^>]*>'
done

Nothing printed means it is missing. The same address on every route means every page tells Google the real page is the home page. A different domain, say the preview site where the project was built, is worse: it says your content lives somewhere else.

The prompt to give your builder

In the <head> of every page on the site, add a
<link rel="canonical"> with that page's absolute, final URL (https,
with or without www, whichever the site uses). It must point at the
page itself, with no parameters or fragment, and it must be in the
HTML the server sends, not only added by JavaScript. If one already
exists, fix it instead of adding a second.
Return a table with each route and its canonical.

After the fix, the documentation warns that Google can keep pages in the same duplicate group for up to two weeks, so do not expect the change overnight.

The Slop Score Pro checks this on every page: it flags the ones that do not say their URL and the ones pointing to another site, with a prompt for each. Start by measuring your site from the field on the home page, and if repeated titles across pages worry you, read the post on repeated titles.

Sources

Frequently asked questions

What happens if I do not add a canonical tag?

Google picks which version of the page to show. It often gets it right, but you have no control and signals can be split across several addresses.

Is rel=canonical required by Google?

No. It is a strong signal, not a command: Google may choose another URL based on content quality or technical signals.