technical

Canonical tags

MetricSpot checks for a `<link rel="canonical">` declaring this page's preferred URL. Without it, duplicate URLs split your SEO authority.

What this check does

Parses the rendered HTML <head> for <link rel="canonical" href="...">. The href must be an absolute URL pointing at the version of this page you want Google and AI crawlers to index.

Why it matters

Most websites have multiple URLs that return the same content: ?utm_source=… tracking, mixed case, trailing slashes, http:// vs https://, www. vs apex, pagination, faceted-search filters. Without a canonical, Google treats each variant as a separate page and divides ranking signals across them.

The canonical tag tells search engines and AI crawlers: “Of all these URLs that show this content, this one is the source of truth. Attribute all links and ranking to it.”

How to fix it

Add a self-referential canonical to every page’s <head>:

<link rel="canonical" href="https://yourdomain.com/exact-page-url/" />

Rules:

  • Absolute URL. Include scheme (https://) and host. Relative URLs technically work but ambiguous in edge cases.
  • One per page. Multiple canonicals get ignored.
  • Points to the indexable version. Strip tracking params, normalize trailing slash, use the canonical host (apex or www, pick one).
  • Matches the URL in your sitemap and internal links. A canonical that contradicts your sitemap confuses Google.

Framework helpers:

  • Next.js (App Router): export const metadata = { alternates: { canonical: 'https://yourdomain.com/page' } }
  • Astro: in your Layout — <link rel="canonical" href={new URL(Astro.url.pathname, site).href} />
  • WordPress: Yoast / Rank Math / SEOPress all emit canonicals by default.

Frequently asked questions

Can a page canonical to a different URL?

Yes — that’s cross-domain canonicalization, used when you syndicate content or migrate URLs. The downside: Google may consolidate all ranking to the target URL, dropping the source page from results.

What about pagination?

Each paginated page should self-canonical (page 2 canonicals to page 2). Google retired rel="prev/next" as a ranking signal in 2019.

Does the trailing slash matter?

It matters that you’re consistent. Pick one form (/about/ or /about), make your server enforce a 301 to that form, and make canonicals match. Mismatches cause Google to flip between versions and waste crawl budget.

Sources

Last updated 2026-05-11