Generate production-ready rel="alternate" hreflang tags for HTML, XML Sitemaps, and HTTP headers with ISO 639-1 & ISO 3166-1 standards, or audit any live URL for reciprocal return links and x-default compliance.
| Language (ISO 639-1) | Country/Region (ISO 3166-1) | Target Webpage URL | x-default | Action |
|---|
When your website serves visitors in multiple countries or languages, hreflang annotations prevent duplicate content confusion and ensure Google serves the correct regional page. Without proper hreflang tags, an American customer might land on your Australian pricing page, or a Spanish speaker in Mexico might be directed to European Spanish content.
Hreflang operates reciprocally. If English Page A links to Spanish Page B, Page B must link back to Page A. If return links are missing, Googlebot disregards both annotations!
Every localized page must include an hreflang tag pointing to itself alongside all of its alternate regional versions. This confirms the page's own language identity.
Always designate an x-default URL. It catches unmatched visitors whose location or language has no specific translation, forwarding them safely to your global homepage.
The most common method. Placed directly inside the <head> of each webpage.
Annotated via <xhtml:link> within your XML Sitemap index. Keeps HTML page size lean and uncluttered.
Delivered through response headers (Link: <...>; rel="alternate").
en-UK causes Google to completely ignore your British targeting.
https://example.com/es/, never /es/).
hreflang="es"), or a language + country (hreflang="es-MX"), but you CANNOT target a country alone (hreflang="MX" is invalid).
An hreflang tag is an HTML link attribute that indicates the language and geographical targeting of a webpage. It tells Google which URL should be displayed in search results based on the searcher's country and preferred language.
The x-default hreflang attribute designates the fallback page shown to international users whose location or language is not explicitly targeted by any other version, or for landing pages featuring a global country selector.
ISO 639-1 defines two-letter language codes (e.g. en for English, es for Spanish, bn for Bengali). ISO 3166-1 Alpha-2 defines two-letter country/region codes (e.g. US for United States, GB for United Kingdom, BD for Bangladesh). In hreflang syntax, language always comes first, followed by an optional country code separated by a hyphen (e.g. en-US).
Yes. When you provide regional variations of identical content (such as US English, UK English, and Australian English with localized currencies and addresses), hreflang prevents Google from treating these pages as duplicate content.
Google requires mutual confirmation so that third-party domains cannot arbitrarily claim to be the Spanish or French translation of your site. If page A claims page B is its Spanish translation, page B must explicitly confirm by pointing back to page A.