Skip to main content

SEO / AEO Global Rules

Hreflang & canonical

Hreflang & canonical — documentation pending.

Complete

Hreflang tells crawlers the EN and AR versions of a page are alternates of the same content — not duplicates. The canonical link declares which URL is authoritative. Together they prevent duplicate-content penalties and route searchers to the right locale.

The 3-link pattern on every page

  • <link rel="canonical" href="…"> Absolute URL of the CURRENT page. Tells crawlers "this is the canonical version, not /?utm=… or /trailing-slash/".
  • <link rel="alternate" hreflang="en" href="…/en/…"> Points to the English version of this content. Required even when the current page IS English.
  • <link rel="alternate" hreflang="ar" href="…/ar/…"> Points to the Arabic version. Same content / same slug / different locale prefix.
  • <link rel="alternate" hreflang="x-default" href="…/en/…"> The fallback target when crawlers cannot map a user’s language to a defined alternate. Always points to EN.

When French ships

A fourth `<link rel="alternate" hreflang="fr" href="…/fr/…">` is added on every page that has a French translation. Pages without an authored French version do NOT emit the FR alternate — emitting a hreflang pointing to a 404 or to an EN-fallback page is worse than no hreflang at all.