Most people who own a multilingual website have never heard of hreflang. Most people who have heard of it learned the hard way — usually when half their traffic ended up on the wrong page. This guide is the version I wish I had read first.
01What hreflang is, in one sentence
hreflang is a tag that tells Google: "this page is the English version, that page is the Spanish version, and that one over there is the French version." That's it. That's the whole job.
Google uses the tag to show the right page to the right person — Spanish readers see the Spanish page, French readers see the French page, and nobody ends up on a version they can't read.
Think of hreflang as the little label on a hotel door: EN — FR — ES — DE. The hotel still has one front desk. The label just tells you which room you want.
02Why you actually need it
Without hreflang, Google guesses. It will look at your domain, your language, your visitor's country, and pick a page for them. Often it picks right. Sometimes it doesn't — and "sometimes" is the part that hurts.
Three things go wrong when you skip hreflang:
- Your French page shows up in English search results, so French readers click and bounce.
- Google sees your English and Spanish pages as duplicates and ranks neither.
- Your beautiful translated content is invisible because Google never knew it existed in that language.
The fix is, honestly, embarrassingly small. One tag per page. That's it.
03The three things hreflang tells Google
Every hreflang tag carries three pieces of information:
- The language — using a two-letter code like
en,es,de. - The region (optional) — like
en-USversusen-GB, when the content actually differs. - The URL — the address of the page in that language.
Stacked on a page, the set looks like this:
<!-- in the <head> of every translated page -->
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="de-AT" href="https://example.com/de-at/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" /> Two rules to keep in your back pocket:
- Every page must list every version, including itself. (Yes, even the English page lists the English page. Yes, this looks weird. Yes, you have to do it.)
- It has to go both ways. If page A points to page B, page B has to point back to page A. Otherwise Google ignores both.
The single most common hreflang bug I see is a page that lists its siblings but forgets to list itself. Google quietly throws the whole set out.
04Where the tag lives
You have three places to put hreflang. Pick one. Don't mix them — Google won't know which to trust, and you'll spend an afternoon reading conflicting Stack Overflow posts.
| Place | Best when | Watch out for |
|---|---|---|
| HTML head | Small or mid-sized sites. Easy to read in the source. | Each page must list every translation. Pages get heavy fast. |
| Sitemap.xml | Big sites with hundreds or thousands of pages. | Sitemap must stay in sync. Slower for Google to discover. |
| HTTP headers | Non-HTML files (PDFs, images served by URL). | Hardest to debug. Set up at the server level. |
For 95% of sites, the HTML head is the right answer. It's the easiest to inspect, the easiest to debug, and the easiest to fix when something goes wrong.
05The x-default escape hatch
There's one more tag you should always include: x-default. It says, "if none of these other languages match, show this one."
It's the safety net. A reader in Iceland visiting your site? You don't have Icelandic. x-default kicks in and serves them your English page — or wherever your global homepage lives.
Most teams point x-default at their English page. Some point it at a "choose your language" page. Either is fine. Don't skip it.
06Five common mistakes
I've audited maybe two hundred multilingual sites. These five mistakes show up in roughly nine out of ten.
1. Forgetting the self-reference
The English page must include a tag pointing to itself. Same for every other language. Skip it and Google throws the whole cluster out.
2. Mismatched URLs
Your hreflang points to example.com/es, but the actual Spanish page lives at example.com/es/ (with a trailing slash). Google treats these as different URLs. Be consistent.
3. Pointing at redirects
hreflang must point at the final destination — not at a URL that redirects to it. Otherwise Google walks the chain and gives up.
4. Wrong language codes
It's en, not eng. It's zh, not cn. It's nb for Norwegian Bokmål, not no. Use BCP 47 codes and double-check.
5. Mixing language and country
If your German content is identical for Germany, Austria and Switzerland — just use de. Don't use de-DE, de-AT, de-CH unless the content actually differs. You're inviting trouble for no reason.
▸ Key takeaways
- hreflang tells Google which page is which language. One tag per version.
- Every page lists every version, including itself. Links go both ways.
- Always include
x-defaultfor readers in languages you don't support. - Use real BCP 47 codes. Don't mix language and country unless content differs.
- Pick one place — head, sitemap, or HTTP — and stay there.
07How Nayda handles it for you
If you're using Nayda, you already have hreflang. You don't have to write it, maintain it, or remember to update it. Here's what we do under the collar:
- Every translated page automatically lists every other language version, plus itself, plus
x-default. - Links go both ways by construction — if a page exists, all its siblings know about it.
- Codes are real. We use BCP 47 throughout. No guessing.
- Sitemap entries too. Your sitemap.xml gets
xhtml:linkannotations for every alternate. - When you delete a language, every page in the cluster updates within a minute. No orphaned tags.
"hreflang is one of those things that's tedious when you do it by hand and invisible when it's done right. That's why we automate it — you should be writing content, not staring at language tags."
08Frequently asked questions
Do I need hreflang if my site only has one language?
Where should hreflang tags go?
<head> of each page, in your sitemap.xml, or in HTTP response headers. Pick one and stick with it — mixing them confuses Google.What is x-default and do I really need it?
Does hreflang fix translated meta tags?
How long until Google picks up my hreflang changes?
Can I use hreflang for the same language across regions?
en-US, en-GB, en-AU. Only do this if the content actually differs between regions. If it's identical, plain en is cleaner.09TL;DR
hreflang is one tag per language version of your page, pointing to its sibling URLs, with a bonus x-default for unknown readers. Every page lists every version, including itself, with links going both ways. Pick one place to put them. Use real language codes. Don't overthink it — and if you're on Nayda, you're not even thinking about it.
Mira Kovač
Head of SEO at Nayda. Spent eight years on the technical SEO team at a publishing house with twelve language editions. Now writes about the things she had to learn the hard way.