← Back to blogGLOSSARY

What is a canonical URL?

A canonical URL tells search engines which version of a page is the main one, preventing duplicate content. Explainer plus a Next.js example.

What is a canonical URL?

A canonical URL is an HTML tag, <link rel="canonical" href="...">, placed in the <head> of a page that tells search engines which URL is the 'main version' when the same or similar content is reachable via multiple URLs.

Why is it needed? Duplicate content

Take example.com/product and example.com/product?utm=fb: technically two different URLs, exactly the same content. Without a canonical, Google might index the wrong version, ranking signals such as links can splinter across multiple URLs, or in rare cases a duplicate-content penalty could apply.

Other common sources of duplicate URLs: filter parameters on a product listing, sort-order parameters, and http vs https variants of the same page.

How do you implement it in HTML

Add the tag inside the <head> of your page: <link rel="canonical" href="https://example.com/product" />. Every page, including the canonical target itself, should have a self-referencing canonical, a tag pointing to its own URL. That's standard practice for every unique page.

Cross-domain canonical

A less common use case: when the same content lives on two different domains, for example a syndicated article that also appears on a partner site, you can point the canonical on the copy to the original domain. That prevents the copy from ranking instead of the original.

Common mistakes

A handful of mistakes show up repeatedly and are worth checking on your own site.

  1. Missing self-canonical: the page points to nothing, or accidentally to a different page.
  2. Canonical pointing to a noindex page, a contradictory signal to search engines.
  3. Canonical pointing to http instead of https, or vice versa.
  4. Trailing-slash inconsistency between the canonical and the actual URL.
  5. Canonical that doesn't match the hreflang set on multilingual sites.

In Next.js: via alternates.canonical

In Next.js you set the canonical via the metadata API instead of writing HTML by hand: export const metadata = { alternates: { canonical: "https://example.com/product" } }. This generates exactly the same <link rel="canonical"> tag, but type-safe and managed centrally per page.

Want to know if your site has duplicate-content risks?

Request a technical SEO check →
FREQUENTLY ASKED QUESTIONS

Need a quick answer?

Is a canonical URL required?

Not technically required, but strongly recommended as soon as your site can generate multiple URL variants of the same content, for example through filters, UTM parameters or sort order.

What happens without a canonical?

Google picks a 'representative' URL itself, which isn't always the one you'd choose. Ranking signals like links and authority can also splinter across multiple URL variants.

Can a canonical point to a page on a different domain?

Yes, that's called a cross-domain canonical and is used for content syndication or mirrored content across multiple sites.

Is a canonical the same as a 301 redirect?

No. A 301 redirect physically sends visitors and crawlers to a different URL. A canonical keeps the original URL reachable but gives search engines an indexing preference.

Should every page have its own URL as canonical?

Yes, that's called a self-referencing canonical and is standard practice for every unique page on your site.

DIY or outsource?

Ready to apply what you just read? These are the logical next steps if you'd rather leave it to an agency.

Keep reading

In this series

Technical SEO under control?

Prevent duplicate content
before it costs you rankings.

We check canonicals, redirects and indexing signals across your entire site and fix what's broken.