Hreflang Tags: Complete Guide for International SEO
What Are Hreflang Tags?
Hreflang tags are HTML attributes that tell search engines which language and regional version of a page to show to users in different locations. If your website has content in multiple languages or regional variations (like English for the US, UK, and Australia), hreflang tags ensure that users see the correct version in search results.
Without hreflang tags, Google might show your Australian English pricing page to users in the UK, or your Spanish page to Portuguese-speaking users in Brazil. This leads to higher bounce rates, confused users, and wasted crawl budget. Proper hreflang implementation is a cornerstone of international SEO strategy.
When Do You Need Hreflang Tags?
Hreflang tags are necessary in these scenarios:
- Multilingual content — Your site has the same content translated into different languages (English, French, German).
- Regional variations — Your site has different versions for the same language in different countries (English for US, UK, Australia with different pricing, spelling, or regulations).
- Mixed scenarios — Combinations of language and region, such as French for France, French for Canada, and English for Canada.
You do not need hreflang tags if your site is only in one language with one regional audience.
Hreflang Syntax
HTML Link Elements
The most common implementation is placing <link> tags in the <head> of each page:
<link rel="alternate" hreflang="en-us" href="https://example.com/page">
<link rel="alternate" hreflang="en-gb" href="https://example.co.uk/page">
<link rel="alternate" hreflang="en-au" href="https://example.com.au/page">
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page">
<link rel="alternate" hreflang="x-default" href="https://example.com/page">
Language and Region Codes
Hreflang values follow the ISO format:
- Language only:
en,fr,de,es,ja(ISO 639-1 codes). - Language + region:
en-us,en-gb,fr-ca,pt-br(ISO 639-1 + ISO 3166-1 Alpha 2). - x-default: A special value indicating the fallback page for users whose language/region does not match any specified hreflang.
The language code is always lowercase. The region code is typically lowercase in hreflang attributes (though Google accepts both cases).
HTTP Headers
For non-HTML files like PDFs, use HTTP headers:
Link: <https://example.com/doc.pdf>; rel="alternate"; hreflang="en",
<https://example.com/fr/doc.pdf>; rel="alternate"; hreflang="fr"
XML Sitemap
You can also declare hreflang in your XML sitemap. This is useful for large sites with many language variants:
<url>
<loc>https://example.com/page</loc>
<xhtml:link rel="alternate" hreflang="en-us" href="https://example.com/page"/>
<xhtml:link rel="alternate" hreflang="en-gb" href="https://example.co.uk/page"/>
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/page"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page"/>
</url>
The x-default Tag
The x-default hreflang value specifies the default page for users whose language or region does not match any of your hreflang declarations. This is typically your main English page or a language selector page:
<link rel="alternate" hreflang="x-default" href="https://example.com/">
Every hreflang implementation should include x-default. Without it, Google has no guidance for users who do not match any specified language/region combination.
Bidirectional Requirement
Hreflang declarations must be bidirectional. If page A references page B as an alternate, page B must also reference page A. This is called return link validation:
Page A (English):
<link rel="alternate" hreflang="en" href="https://example.com/page">
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page">
Page B (French):
<link rel="alternate" hreflang="en" href="https://example.com/page">
<link rel="alternate" hreflang="fr" href="https://example.com/fr/page">
Both pages must contain the complete set of hreflang links, including a self-referencing tag. If page A points to page B but page B does not point back to page A, Google ignores the hreflang for that pair.
Common Hreflang Mistakes
Missing Return Links
The most frequent error. One language version references the others, but the other versions do not reference back. Always ensure every page in the set contains the full set of hreflang links.
Wrong Language or Region Codes
Using en-uk instead of en-gb is a common error. The UK’s ISO 3166-1 Alpha 2 code is GB, not UK. Similarly, jp is not a valid language code for Japanese (it should be ja).
Use the seokit hreflang generator to generate tags with correct ISO codes and avoid these common syntax errors.
Pointing to Non-Canonical URLs
Hreflang URLs must point to the canonical version of each page. If https://example.com/page has a canonical tag pointing to https://example.com/page/ (with trailing slash), the hreflang should also use the trailing slash URL.
Mixing Implementation Methods
Using hreflang in both HTML <link> tags and XML sitemaps for the same pages creates conflicts. Choose one method and use it consistently.
Missing Self-Reference
Each page must include a hreflang tag that references itself. The English page needs a hreflang="en" pointing to its own URL, not just tags pointing to other language versions.
Using Hreflang for Identical Content
Hreflang tags should only connect pages that are translations or regional variations of the same content. Do not use hreflang to connect unrelated pages that happen to be in different languages.
URL Structure for International Sites
Your URL structure affects how hreflang integrates with your overall international SEO approach:
Subdirectories (Recommended for Most Sites)
example.com/en/page
example.com/fr/page
example.com/de/page
Advantages: single domain authority, easy to manage, lower cost.
Country-Code Top-Level Domains (ccTLDs)
example.com (US)
example.co.uk (UK)
example.de (Germany)
Advantages: strongest geo-targeting signal, user trust. Disadvantages: separate domain authority, higher cost.
Subdomains
en.example.com
fr.example.com
de.example.com
Advantages: easy to set up, can host on different servers. Disadvantages: often treated as separate sites by search engines.
Testing Your Hreflang Implementation
Google Search Console
The International Targeting report in Google Search Console shows hreflang errors including missing return links, unknown language codes, and unreachable hreflang URLs.
seokit Hreflang Generator
The seokit hreflang generator validates your hreflang implementation by checking for bidirectional links, correct ISO codes, and consistency with canonical tags. Use it during development to catch errors before they affect your search rankings.
Manual Verification
- View the source of each language version and verify the hreflang tags are present.
- Check that every page contains a self-referencing hreflang tag.
- Verify that every reference has a matching return link on the target page.
- Confirm all URLs are absolute and match the canonical URLs.
Conclusion
Hreflang tags are essential for any website serving content to multilingual or multi-regional audiences. The implementation requires precision — a single missing return link or wrong country code can break the entire setup for that page pair.
Start by generating correct hreflang markup with the seokit hreflang generator, validate your overall meta tags with the meta tag generator, and monitor the International Targeting report in Google Search Console to catch issues early.