Skip to main content
Best Web Developer — web design, development and digital growth agency
Language and currency EN $ USD

Language

  • More languages coming soon

Currency

Prices on this site are shown in the currency you choose.

Documentation

Hreflang: language and regional URL annotations

A practical guide to implementing reciprocal hreflang annotations in HTML and XML sitemaps, with examples, common errors, and verification steps.

What hreflang tells search engines

Hreflang annotations identify language or regional alternatives for pages that have substantially equivalent content. They help search engines understand which URL may suit a language and region. They are signals, not commands, and do not replace useful localized content, canonical URLs, or clear navigation.

HTML implementation

Each alternate page should list the complete set, including its own URL. Use absolute URLs and valid language tags:

<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/page/">
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr-fr/page/">
<link rel="alternate" hreflang="x-default" href="https://example.com/language-selector/">

The English page and French page should both publish the same alternate set. Use x-default for a language selector or a fallback page when appropriate. It is optional.

XML sitemap implementation

<url>
  <loc>https://example.com/en-gb/page/</loc>
  <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/page/"/>
  <xhtml:link rel="alternate" hreflang="fr-FR" href="https://example.com/fr-fr/page/"/>
</url>

When hreflang is included in an XML sitemap, each URL entry in the cluster should repeat all alternatives. Declare the XHTML namespace on the sitemap root.

Common errors

  • One page omits a return annotation.
  • Alternates point to redirects, errors, or non-canonical URLs.
  • Language codes use an invalid or inconsistent format.
  • Canonical tags point to another language version when each localized page should be canonical to itself.
  • Alternates refer to pages that are not genuinely equivalent.

How to verify

  1. Fetch each page and confirm the tags are present in its HTML or sitemap.
  2. Confirm each URL is absolute, accessible, canonical, and indexable.
  3. Check every alternate page links back to the complete cluster.
  4. Use Search Console and other search-engine tools to monitor the pages after publication.

Use the hreflang Tags Tester to inspect a source and compare reciprocal links for supplied URLs. See the XML Sitemap Generator for sitemap annotations.

Questions

Common questions

The things clients actually want to know — costs, timelines, ownership and what happens after launch.

They help search engines understand localized alternatives. They do not guarantee a particular result or ranking.

No. It is optional and is useful for a language selector or a fallback page.

Usually yes when each page is a distinct localized version. Do not canonicalize all language pages to one language.

Last reviewed: by the Best Web Developer engineering team.

Free strategy session

Let’s build something worth finding.

Tell us where you want the business to be in twelve months. We will come back with a costed plan, a realistic timeline, and the numbers we expect to move — no obligation, no jargon.

  • 30-minute call, no pitch deck
  • Fixed-price proposal in 48 hours
  • You own everything we build

Talk to a developer

Not a sales team

Response time
Within 1 business hour
Where we work
UK, USA & the Gulf
Contracts
No lock-in, monthly rolling
Working since
2023
infobestwebdeveloper.org

Free strategy session

Let’s build something worth finding.

Tell us where you want the business to be in twelve months. We will come back with a costed plan, a realistic timeline, and the numbers we expect to move — no obligation, no jargon.

  • 30-minute call, no pitch deck
  • Fixed-price proposal in 48 hours
  • You own everything we build

Talk to a developer

Not a sales team

Response time
Within 1 business hour
Where we work
UK, USA & the Gulf
Contracts
No lock-in, monthly rolling
Working since
2023
infobestwebdeveloper.org
Free consultation