Hreflang Tags

SEO, AEO & GEO Glossary

Hreflang tags are link annotations in HTML, HTTP headers or XML sitemaps that map each page to its language and regional versions for search engines.

What are Hreflang Tags?

Hreflang tags are the annotations that tell search engines which language and regional versions of a page exist and which locale each one targets. They can be placed as <link rel="alternate" hreflang="..."> elements in the HTML head, as Link HTTP headers or as xhtml:link entries in an XML sitemap. Google uses them to serve the right version to each user.

The underlying concept is covered in the hreflang entry. This page focuses on implementation choices and errors.

How it works

Three implementation methods:

MethodBest forWatch out for
HTML <link> in headSmall to mid-size sitesAdds weight to every page
HTTP Link headerPDFs and non-HTML filesHarder to audit
XML sitemapLarge multilingual sitesSitemap must stay in sync

XML sitemap example:

<url>
  <loc>https://example.com/us/pricing</loc>
  <xhtml:link rel="alternate" hreflang="en-us"
    href="https://example.com/us/pricing"/>
  <xhtml:link rel="alternate" hreflang="de"
    href="https://example.com/de/preise"/>
</url>

Each URL in the set must list every alternate, including itself, and every alternate must link back.

Examples

  • A SaaS company with 6 locales and 2,000 pages moves hreflang from HTML into its sitemap generator, removing thousands of lines of markup from page templates.
  • A security vendor publishes German and French versions of its compliance whitepaper as PDFs and adds hreflang via HTTP headers.
  • An audit finds hreflang="en-uk" across a site. Correcting it to en-gb makes the annotations valid.

Best practices

  • Generate hreflang automatically from a single source of truth for page equivalents.
  • Use absolute, canonical, indexable URLs that return 200.
  • Add x-default for unmatched users.
  • Validate after every release that touches templates, URLs or locales.
  • Document which method you use so developers do not add a second one.

Common mistakes

  • Missing return links (A references B, but B does not reference A).
  • Invalid codes, such as “en-uk”, “jp” for Japanese (should be “ja”) or region without language.
  • Annotations pointing to redirected URLs after a migration.
  • A canonical tag pointing to another language version.

How to audit hreflang tags

A practical audit takes four passes:

  1. Crawl the site with hreflang extraction enabled and export every annotation.
  2. Validate codes against ISO 639-1 language and ISO 3166-1 region lists.
  3. Check reciprocity: every pair must reference each other, and each page must reference itself.
  4. Cross-check status and canonicals: every target should return 200, be indexable and be self-canonical.

Then confirm the outcome in Search Console by filtering performance by country and checking which URL earns impressions in each market. If the wrong locale still dominates, look for conflicting signals such as internal links that point only to one version.

Sources

Frequently asked questions

Which hreflang implementation method is best?

All three are supported by Google. HTML link elements are easy for small sites. XML sitemaps keep page code light and are easier to manage at scale. HTTP headers are mainly for non-HTML files like PDFs. Use one method consistently rather than mixing them for the same URLs.

How do I check if my hreflang tags are working?

Crawl the site with a tool like Screaming Frog to validate return links, codes and canonical conflicts. Use Search Console's URL Inspection to confirm Google's chosen canonical, and check performance by country to see whether the right version gets impressions in each market.

Do hreflang tags need to point to absolute URLs?

Yes. Google requires fully qualified URLs, including the protocol, such as https://example.com/de/. Relative URLs are a common cause of hreflang errors. Each URL should also return a 200 status, be indexable and match its own canonical tag. Pointing hreflang at redirects, noindexed pages or non-canonical variants causes Google to ignore those annotations.

International SEOTechnical SEO

Do not let AI keep
recommending someone else

Start your 7-day free trial and get your AI Visibility Score in about a minute. See exactly where you stand, where competitors are beating you, and the ranked fixes to get into the answer. Cancel anytime before the trial ends.

7-day free trial. Cancel anytime before it ends. Trusted by 500+ B2B SaaS teams.

Partnered with
Powered by