🌍 Hreflang Implementation Guide
Master international SEO with proper language targeting
What Is Hreflang?
Hreflang is an HTML attribute used to indicate the language and geographical targeting of a webpage. It helps search engines serve the correct language version of a page to users in different countries or speaking different languages.
Without proper hreflang implementation, Google might show the wrong language version to users, leading to poor user experience and potential duplicate content issues.
Language Targeting
Show English content to English speakers
Geo Targeting
Show UK English to UK users, US English to US users
Avoid Duplicates
Signal variations are related, not duplicate content
📝 Hreflang Format
(ISO 639-1)
(ISO 3166-1 Alpha-2)
🗣️ Language Only
en
English (any country)
es
Spanish (any country)
fr
French (any country)
de
German (any country)
🌍 Language + Region
en-GB
English for United Kingdom
en-US
English for United States
es-MX
Spanish for Mexico
pt-BR
Portuguese for Brazil
⚙️ Implementation Methods
HTML Link Tags
Add link tags in the <head> section of your HTML. Best for most websites.
XML Sitemap
Add hreflang to your sitemap. Best for large sites with many pages.
HTTP Headers
Use HTTP headers for non-HTML files (PDFs, images).
🌐 x-default Explained
The x-default value is a special hreflang attribute that designates the fallback page for users who don't match any of your other language/region targeting.
⚠️ Common Hreflang Errors
❌ Missing Return Links
Every page must link back to the originating page. If Page A links to Page B, Page B must link back to A.
❌ Wrong Language Codes
Using invalid codes like "uk" for Ukrainian (should be "uk" or "ua" for region). Country ≠ Language!
❌ Missing Self-Reference
Each page should include a hreflang link pointing to itself for its own language.
❌ Conflicting Signals
Having hreflang pointing to a different URL than the canonical tag.
❌ Non-Absolute URLs
Using relative URLs instead of full absolute URLs with protocol.
❌ Broken Links
Hreflang pointing to pages that return 404 or redirect.
🛠️ Hreflang Testing Tools
Hreflang Tags Testing Tool
Test hreflang implementation
Google Search Console
International targeting reports
Screaming Frog
Crawl and audit hreflang
Ahrefs Hreflang Checker
Validate implementation