Blog / Technical SEO /
Hreflang basics for multilingual sites
You translate your site into French. Proud moment. A month later, someone in France searches for your business and Google shows them the English page. Someone in Lagos gets the French one.
That’s the problem hreflang solves. It’s a way of telling Google: these pages are versions of each other, and this one is for French speakers, this one for English speakers, this one for people in a particular country.
It’s also one of the most commonly broken bits of technical SEO. The idea is simple. The details are fiddly.
What hreflang does
Hreflang is an attribute that says which language (and optionally which region) a page is for, and lists its alternative versions.
It helps Google:
- show the right version to the right searcher
- understand that similar pages in different languages or regions aren’t competing duplicates
What it doesn’t do
- It doesn’t translate anything or redirect anyone.
- It doesn’t boost rankings. It helps the correct version appear where you already rank.
- It isn’t a command. Google treats it as a strong hint, alongside other signals.
- It isn’t needed on a site in one language for one market.
When you need it
- Different languages: English and French versions of the same pages.
- Same language, different regions: a UK page priced in pounds and a Nigerian page priced in naira, with otherwise similar content.
- Both: English for the UK, English for Nigeria, French for France.
If you only have one version of each page, you don’t need hreflang. Plenty of sites add it “just in case” and create problems for nothing.
How the codes work
Hreflang values use:
- a language code in ISO 639-1 format:
en,fr,yo,ha,ar - optionally a region code in ISO 3166-1 alpha-2 format:
GB,NG,US,FR
Combined with a hyphen: en-GB, en-NG, fr-FR.
Things to know:
- The language comes first. You can’t use a region on its own:
NGisn’t valid,en-NGis. en-UKis a common mistake. The UK’s code isGB.- There’s a special value,
x-default, for the page to show when no other version fits, often a language picker or your main international page.
The three ways to add it
1. In the HTML head
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="en-NG" href="https://example.com/ng/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Every version of the page carries the same full set, including a line pointing to itself.
2. In the XML sitemap
Each URL lists its alternates with xhtml:link entries. This keeps the page code clean and is easier to manage on big sites.
3. In HTTP headers
Mainly for non-HTML files like PDFs.
Pick one method. Mixing them makes errors harder to find.
The rules that make it work
- Return links. If page A says page B is its French version, page B must say page A is its English version. Missing return links are the most common reason hreflang gets ignored.
- Self-reference. Each page includes itself in the list.
- Full, absolute URLs, including
https://. - Point at indexable, canonical pages. Not redirects, not noindexed pages, not 404s. Each language version should have a canonical pointing to itself, not to the English version. (More on canonicals in canonical tags explained.)
- Real equivalents. Link pages to their actual counterparts, not every page to the home page.
On WordPress
WordPress doesn’t do multilingual on its own. The common plugins, such as WPML, Polylang and TranslatePress, add hreflang tags automatically once your translations are connected to each other.
The plugin is only as good as the connections. Check that:
- each translation is linked to its original in the plugin
- the language and region settings use the codes you intended
- untranslated pages aren’t pointing to empty or placeholder versions
How to check it
- View the page source and search for
hreflang. Is the full set there, with a self-reference? - Open each alternate and check its source too. Do the return links exist?
- Crawl the site with a tool like Screaming Frog, which reports missing return links, wrong codes and non-canonical targets.
- Search Console: Google retired the old International Targeting report in 2022, so a crawler and spot checks are now the most reliable way to catch errors.
A note on translation quality
Hreflang only helps if the translated page is worth showing. Machine-translated pages nobody checked often read badly to native speakers, and search engines are getting better at noticing. If you’re adding a language, budget for someone fluent to review it. Search behaviour differs between languages too: people don’t always search for the direct translation of your English keyword.
Related reading
- Canonical tags explained with real examples
- Duplicate content on WordPress: common causes and fixes
- XML sitemaps on WordPress: what to include and what to leave out
If your site has more than one language or region, open one translated page’s source now and look for the return link. Is it there?