Skip to content
hreflang reference

hreflang="x-default" — Correct Usage

Copy-paste correct usage for Default / language-selector page — HTML, sitemap syntax and the mistakes to avoid.

x-default codeDefault / language-selector page targetsfallback type

x-default is the fallback entry in an hreflang cluster: it points search engines to the URL to show when no listed language matches the searcher. Use exactly one per cluster, usually your default-language page.

x-default is not a language: it marks the URL search engines should show when no other hreflang entry matches the user. Point it at your default-language page or a language selector.

HTML head implementation

<link rel="alternate" hreflang="x-default" href="https://example.com//" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

XML sitemap implementation

<url>
  <loc>https://example.com/</loc>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>

Rules that trip people up

  • Reciprocity: every alternate must link back to every other one, including itself.
  • Valid syntax: ISO 639-1 language, optionally “-” + ISO 3166-1 country (or UN M49 region like 419).
  • Point only at canonical, indexable, 200-status URLs — never at redirects.
  • hreflang suggests, canonical decides: conflicting canonicals silently break clusters.
Automate it: Transxlate Pro emits the complete, reciprocal hreflang cluster (with x-default) on every page of every language automatically — no manual tags to maintain.

Frequently asked questions

What does hreflang="x-default" mean?

x-default marks the URL search engines should serve when no other hreflang entry matches the user's language — typically your primary-language homepage or a language selector. It is required best practice in every hreflang cluster.

Where do I put hreflang="x-default"?

In one of three places (pick one, consistently): link tags in the HTML head, HTTP headers, or your XML sitemap. Every language version must list all alternates including itself — missing return links invalidate the cluster.

What are the most common hreflang mistakes?

Non-reciprocal links (A lists B, B forgets A), invalid codes (using country codes alone, or “en-EU”), pointing alternates at redirected/noindexed URLs, and forgetting the self-reference. Audit clusters with a crawler after any URL change.

Never hand-write hreflang again

Transxlate generates correct clusters for every language version automatically.