Short answer: Hreflang is a tag that tells Google which pages are language or region versions of each other, such as your English page and its Spanish translation. Google then shows each searcher the most appropriate version. Each version must list itself and all the others, and the links must point both ways.
Hreflang codes that work and codes that don’t
| Code | What it targets | Valid? |
|---|---|---|
es | Spanish speakers anywhere | Yes |
es-US | Spanish speakers in the United States | Yes |
en-US | English speakers in the United States | Yes |
x-default | Searchers whose language you don’t list | Yes |
es-419 | Spanish for Latin America | No, Google doesn’t support it |
US | A region with no language | No, the language is required |
A code is a language from ISO 639-1, optionally followed by a region from ISO 3166-1 Alpha 2. Google names es-419 as unsupported, and a region on its own isn’t valid.
From Google Search Central, “Tell Google about localized versions of your page”, read November 3, 2026.
When to use hreflang
Google recommends it when your site is fully translated, such as English and Spanish versions of each page. It also helps when content in one language has small regional variations, or when only the menus and footer are translated.
Google may find your other language versions without it, but it says explicit tags are usually best. Translated pages don’t count as duplicates; only versions whose main content stays untranslated do.
The rules Google checks
You can declare versions in the HTML head, in HTTP headers or in your sitemap. Google treats the three methods as equivalent, and using all three brings no benefit in Search.
Each version lists itself and every other version, with full addresses that include http or https. If two pages don’t point to each other, Google ignores the tags, so another site can’t claim to be your translation.
Add an x-default version for unmatched languages, especially on language selectors or home pages that redirect.
How to add hreflang to your pages
- List each page with its versions, such as the English page and its Spanish translation.
- Choose the codes, such as en-US and es-US, from the ISO lists.
- In the head of each version, add one link element per version, including the page itself.
- Use full addresses, with http or https, in every href.
- Add an x-default link for searchers whose language you don’t list.
- Check that every version carries the same set of links, so each link has a return link.
- Give each version a canonical page in its own language.
Our guides to canonical tags and to XML sitemaps cover the two other places where language versions must agree.
What our own English and Spanish pages declare
We checked three pairs on November 3: the home page, the local SEO service and the robots.txt guide. In each pair, both versions list the same three links: en-US for English, es-US for Spanish and x-default pointing to English.
Each page also declares its language in the html lang attribute and names itself as canonical. We use es-US rather than es-419, the code Google doesn’t accept.
Before you publish a translation
- Both versions list themselves and each other.
- Every code is a valid ISO language, with an optional region.
- Every href is a full address with http or https.
- An x-default version is set.
- The links sit inside a valid head section.
- Each version’s canonical is in its own language.
RememberHreflang pairs your translations: every version lists all the others and itself, with valid codes and full addresses, and every link has its return link.
If you want us to check your English and Spanish pages, see our technical SEO service.
Quick answers about hreflang
Does hreflang tell Google what language my page is in?
No. Google says it doesn’t use hreflang or the HTML lang attribute to detect a page’s language; it uses its own algorithms. Hreflang tells Google which versions of a page belong together, so it can show the right one to each searcher.
Is es-419 a valid hreflang code?
No. Google supports language codes from ISO 639-1 and region codes from ISO 3166-1 Alpha 2, and it names es-419 as one that isn’t supported. Use es on its own, or a code such as es-US or es-MX.
What does x-default do?
It marks the page for searchers whose language you don’t list, often a home page that redirects or lets people pick a language. Google suggests it as a fallback, especially on language selectors and auto-redirecting home pages.
Are my English and Spanish pages duplicate content?
Not if the main content is translated. Google says localized versions count as duplicates only when the main content stays untranslated, such as a page where only the navigation and footer change language.
Why does Google ignore my hreflang tags?
The most common reason is a missing return link: if page X names page Y, page Y has to name page X too. Google also ignores codes outside the ISO lists and tags that sit outside a valid head section.
Sources
Read on November 3, 2026. Google Search Central: Tell Google about localized versions of your page and How to specify a canonical URL with rel="canonical" and other methods. Our own case: the tags of three English and Spanish pairs of our site, on November 3, 2026.
