Hreflang Tag Generator
Tell Google which language and region each version of your page targets. Add a row per version, set the language (and optional country), and copy the ready rel="alternate" hreflang tags — including x-default.
Place these in the <head> of every listed page (each page must reference all versions, including itself), or add the equivalent entries to your XML sitemap.
What are hreflang tags?
hreflang is an attribute that tells search engines which language and (optionally) which country a specific page is meant for. When you publish the same or similar content in several languages or regions — say an English version for the US and a Spanish version — hreflang annotations help Google serve the right version to the right searcher, instead of picking one and burying the rest as duplicate content.
Each value is a language code (ISO 639-1, e.g. en, es) optionally followed by a region code (ISO 3166-1 Alpha 2, e.g. US, MX). Google reads them case-insensitively, and the common convention is lowercase throughout, like en-us or es-mx.
How to use the generated tags
You have two placement options — pick one and stay consistent:
- In the page
<head>: paste the full block into the<head>of every URL in the set. Crucially, each page must list all versions including itself — the annotations have to be reciprocal or Google may ignore them. - In your XML sitemap: add the equivalent
<xhtml:link>entries so you manage the relationships in one file instead of editing every template.
Why include x-default?
The x-default value marks the fallback page shown to users whose language or region doesn't match any of your specific versions. It's ideal for a language-picker landing page or your primary market's homepage. It's optional but recommended for international sites, which is why it's turned on by default here.
Bilingual is the norm for Miami businesses — an en-us page and an es (or es-us) page cover most local audiences. Keep every version's hreflang set identical and reciprocal, then validate in Google Search Console's International Targeting report before you rely on it.
Need help mapping out a multilingual site the right way? Explore our SEO services or grab another one of our free SEO tools.