Skip to main content

Set a canonical URL on every public page

A canonical link tells crawlers which URL is the authoritative one — preventing duplicate-content penalties.

Worth up to 4 points

Why it matters

Without a canonical, the same content reachable from `https://acme.com/blog/post`, `https://www.acme.com/blog/post`, and `https://acme.com/blog/post?utm_source=x` looks like three pages to crawlers. They split ranking signals across all three. A canonical consolidates them.

How to fix it

  1. 1. Add <link rel="canonical"> per leaf route

    The href should be the absolute, https, www-or-not preferred URL — without query strings or fragments.

    <link rel="canonical" href="https://acme.com/blog/launch" />
  2. 2. Set it on leaves only — not root layout

    TanStack Router concatenates `links` from every matched route. A canonical in `__root.tsx` plus one in your leaf emits two canonical tags — invalid. Put it on leaves only.

  3. 3. Match the canonical to your og:url

    Mismatch confuses crawlers and breaks share previews. Keep them identical.

FAQ

Do I need canonical on paginated pages?
Yes — self-referential. Each `/blog?page=2` should canonicalize to itself, not to page 1.

See your own score

Run a free Crawlable scan to find every check that needs fixing on your site — not just this one.

Check my site

More guides