Hreflang and canonical tags

Hreflang and canonical tags: canonical vs hreflang on multilingual websites

Understand how hreflang and canonical tags, translated URLs, and sitemap entries work together on an international website, and how to fix hreflang canonical conflicts.

/ The short answer

Canonical and hreflang solve different problems. A canonical identifies the preferred URL for one page version; hreflang connects equivalent language or regional versions. A multilingual page usually needs a self-canonical plus reciprocal alternates, not one language canonical for every locale.

/ 01

Canonical

Give each localized page its own canonical

If /en/pricing and /fr/pricing are separate language pages, each should normally identify itself as the canonical URL for that language version. Do not canonicalize every translation to English simply because English was published first.

  • Canonicalize the exact protocol, host, path, and locale URL you want indexed.
  • Keep redirected, parameterized, or duplicate variants out of the canonical set.
  • Use the same canonical policy in metadata and the sitemap.
Self-canonical localized metadata
export async function generateMetadata({ params }) {
  const { locale, slug } = await params;
  const product = await getProduct(slug);
  const path = `/products/${product.slug}`;

  return {
    title: product.seoTitle[locale],
    description: product.seoDescription[locale],
    alternates: {
      canonical: `https://example.com/${locale}${path}`,
      languages: {
        en: `https://example.com/en${path}`,
        fr: `https://example.com/fr${path}`,
        de: `https://example.com/de${path}`,
      },
    },
  };
}
/ 02

Hreflang

Use hreflang to connect equivalent versions

Hreflang tells search engines which language or regional page should serve a searcher. It is a relationship between equivalent versions, not a replacement for canonicalization and not a way to translate a page.

  • Use valid language and region codes.
  • Make the relationship reciprocal.
  • Include x-default only when you have a deliberate default-language or language-selector destination.
/ 03

Common mistake

Do not point every language to the source page

A French page with an English canonical can send a contradictory signal: the page says it is French, while the canonical says the English URL is preferred. Use a cross-language canonical only when the pages are genuinely duplicates and you intentionally want one preferred version.

  • Avoid cross-locale canonicals for translated content.
  • Do not mix www and non-www hosts in the language set.
  • Do not advertise unpublished translations in hreflang.
/ 04

Canonical vs hreflang

Canonical vs hreflang tag: what each one tells search engines

The canonical tag answers which URL to index for this content. The hreflang tag answers which language or regional version to show this searcher. On a correctly built multilingual site, every page answers both: it is its own canonical, and it lists every equivalent language version, including itself, as a rel alternate hreflang link.

  • Canonical: one URL per page, pointing at the preferred version of that same page.
  • Hreflang: one link per language version, repeated identically on every page in the set.
  • Hreflang URLs should always be the canonical URLs of each version, never redirected or parameterized variants.
Hreflang and canonical on the French page
<!-- https://example.com/fr/pricing -->
<link rel="canonical" href="https://example.com/fr/pricing" />
<link rel="alternate" hreflang="en" href="https://example.com/en/pricing" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/pricing" />
<link rel="alternate" hreflang="de" href="https://example.com/de/pricing" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/pricing" />
/ 05

Conflicts

Fix hreflang canonical conflicts

A hreflang canonical conflict happens when the two tags disagree: the French page lists itself as the fr alternate but canonicalizes to the English URL, or an hreflang link points to a URL whose canonical is somewhere else. Search engines may ignore hreflang for URLs that are not canonical, so the language version you wanted shown can drop out of results.

  • Hreflang to a non-canonical URL: replace it with the canonical URL of that language version.
  • Cross-language canonical on a translated page: change it to a self-canonical.
  • Canonical points to a redirect: canonicalize to the final URL instead.
/ 06

Verification

Test the complete signal set

Inspect the rendered head, page language, internal links, sitemap entry, and response status for every locale. A correct tag on one page does not fix a broken or non-reciprocal cluster.

  • Check source and translated page pairs.
  • Compare canonical URLs to sitemap URLs.
  • Check that localized pages contain localized visible text and metadata.

/ Production checklist

Verify the language experience before launch.

  • Every localized page has a self-canonical URL.
  • Hreflang URLs are absolute and reachable.
  • Language mappings are reciprocal.
  • Canonical and sitemap URLs agree.
  • No locale points to an unpublished page.
  • The visible content matches the declared language.

/ Frequently asked questions

Questions teams ask before implementing multilingual SEO.

Should multilingual pages use the same canonical URL?

Usually no. Separate language pages should normally have self-referential canonicals, while hreflang connects them as language alternatives.

Is hreflang a replacement for canonical?

No. Canonical identifies the preferred URL for a page version; hreflang identifies equivalent language or regional alternatives.

Can hreflang prevent duplicate-content problems?

It helps search engines understand language and regional relationships, but each page still needs useful localized content and consistent canonical signals.

What is the difference between canonical and hreflang tags?

A canonical tag picks the preferred URL among duplicates of the same page. A hreflang tag connects different language or regional versions of a page so each searcher sees the right one. They work together rather than replacing each other.

Should the hreflang URL match the canonical URL?

Yes. Each hreflang link should point to the canonical URL of that language version. Linking hreflang to a non-canonical, redirected, or parameterized URL is one of the most common reasons hreflang is ignored.

Can a page have rel alternate hreflang and a canonical to another URL?

Only if the page is a true duplicate you do not want indexed, and then it should not be part of the hreflang set. A translated page that should rank in its own language needs a self-canonical.

Hreflang- und Canonical-Tags: Canonical vs. Hreflang erklärt | Altified