SEO

What Is Hreflang? Syntax, Return Links, x-default and the Errors That Break It

Hreflang is an annotation that tells Google which pages are the same content in different languages or for different regions, so it can show searchers the most suitable version. Every version must list itself and every other version, and each must link back. If the pages do not point to each other, Google ignores the tags.

Prabhu SolutionsPublished 24 October 2026Last reviewed 24 October 202613 min read

On this page
01

What is hreflang?

Hreflang is a label attached to a page that says: this page has equivalents in other languages or regions, and here they are. Google uses these labels to point people to the version that suits their language or location. It does not translate anything, and it does not create the other versions. It connects pages you already have.

The word is short for a pair of terms, language and region, and the annotation carries a code for one or both. An English page for Britain is labelled en-GB, an English page for Ireland en-IE, a German page de. Each page lists all of the versions, including itself, in the same order, so a search engine can see the whole set at once.

Two facts keep expectations sensible. First, Google says it does not use hreflang or the HTML lang attribute to work out what language a page is in; it uses its own algorithms for that. Second, hreflang is about choosing between versions, not about helping any one version rank. If your site serves a single language to a single country, none of this applies, and the wider topic of what is SEO and how does it work is a better use of your time.

The point

First, Google says it does not use hreflang or the HTML lang attribute to work out what language a page is in; it uses its own algorithms for that.

02

Do you need hreflang?

You need hreflang when you publish the same or closely equivalent content in more than one language, or for more than one country in the same language. You do not need it for a site in one language aimed at one market, and you cannot use it to link pages that are not real equivalents.

Your situationNeed hreflang?Why
One language, one country, one set of pagesNo.There are no alternates to point to. Adding annotations would only create something to maintain.
The same content translated into several languagesYes.Google names fully translated content as a case for hreflang. Each translation points to the others.
English pages for the UK, Ireland and the US with small differencesYes.Google lists small regional variations in one language as a case, such as US, GB and Irish English.
Pages where only the template is translated, such as a forum interfaceYes.Google lists this case too, where the main content stays in one language and the surrounding template changes.
A UK site that ships abroad but has no foreign-language or country pagesNo.With no alternate versions of a page, there is nothing to annotate. Ask first whether you are ready for international SEO at all, and for a shop, whether ecommerce SEO at home comes first.
Two sites in different languages that cover different contentNo.Hreflang links equivalents. Pages that are not versions of one another should not be annotated as if they were.
03

What does hreflang look like in practice?

In its simplest form it is a set of link elements in the head of the page, one per version, each naming a language and region code and the full address of that version. The set is identical on every page in the group. A page for the United Kingdom, a page for Ireland and a German page would each carry the same three lines.

Google accepts three methods: link elements in the HTML head, an HTTP header, and entries in an XML sitemap. It treats them as equivalent, so you pick the one that suits your site, and using all three adds maintenance work with no search benefit. HTML suits ordinary pages, headers suit files such as PDFs, and a sitemap suits large sites where editing every page head is impractical.

Whichever method you choose, the principle is that each address on its own line carries the same full list. If you add a new market, every existing page must be updated to include it, and the new pages must list all the old ones. That bookkeeping is where hreflang usually fails on larger sites, so it is worth generating the annotations from a single list rather than writing them by hand. That is a build decision, best settled at the outset of website development rather than patched in later.

The point

Whichever method you choose, the principle is that each address on its own line carries the same full list.

04

What does a hreflang tag contain?

A hreflang link element has three parts: a rel value of alternate, a hreflang value giving the language and optional region, and an href giving the full address of that version. The table reads a typical set for a British site with a German version and a fallback.

LineWhat it declares
<link rel="alternate" hreflang="en-GB" href="https://www.example.co.uk/page/" />The English language page for Great Britain. A region cannot appear on its own, but it can follow a language.
<link rel="alternate" hreflang="en-IE" href="https://www.example.co.uk/ie/page/" />The English page for Ireland. Same language, different region.
<link rel="alternate" hreflang="de" href="https://www.example.co.uk/de/page/" />The German page, for German speakers in any region.
<link rel="alternate" hreflang="x-default" href="https://www.example.co.uk/" />The fallback for visitors who match none of the above, often a language selector page.
06

What is x-default in hreflang?

X-default is a reserved value that names the page to show when no other language or region matches the visitor's browser settings. Google describes it as a fallback, commonly pointing to a language selector page or to the main version of the site. It is optional, and it is not a way to say which version is your favourite.

A sensible use is a site that has English pages for the UK and Ireland and a German page, and a home page that offers all three. A visitor from France matches none of them, so the x-default page is the sensible thing to show. Without it, Google chooses for itself, and may not choose the page you would want.

Keep it consistent with the rest of the set. The x-default address belongs in every page's list, like any other, and it should be an address that loads normally rather than one that redirects visitors by guessing their location. Google recommends avoiding automatic redirects between language versions, because they can stop both users and search engines seeing every version.

The point

The x-default address belongs in every page's list, like any other, and it should be an address that loads normally rather than one that redirects visitors by guessing their location.

07

Which language and region codes does hreflang accept?

Hreflang values use two standards: ISO 639-1 for languages and ISO 3166-1 Alpha 2 for regions. A language can stand alone, a region cannot, and the code for the United Kingdom is GB, not UK. Using an unofficial code means Google ignores that part of the annotation.

  • Language alone is valid: en, de, fr. It applies to speakers of that language in any region.
  • Language plus region is valid: en-GB, en-IE, de-AT. The language comes first and the region second.
  • A region by itself is not valid. You cannot write GB or IE alone.
  • Use GB for the United Kingdom. Google states that using EU, UN or UK in hreflang annotations has no effect, so a tag written as en-UK loses its region.
  • Script codes are supported for languages such as Chinese, for example zh-Hans and zh-Hant. A broader code such as es-419 is not supported.
  • Values are not case-sensitive, but the convention is lower-case language and upper-case region, as in en-GB.
  • If several regions share a language, consider offering a generic version of that language as a catch-all for visitors from other regions.
08

How should you structure the URLs for different languages and countries?

Use a different address for each version, whether that is a country domain, a subdomain or a subdirectory. Google recommends separate addresses over cookies or browser settings, because separate addresses let both users and search engines reach every version. The choice is a business decision, not a ranking trick.

StructureExampleIn its favourAgainst it
Country domainexample.deA clear signal of the country targeted, and easy to separate sites.Can be costly or restricted, needs more infrastructure, and targets one country only.
Subdomainde.example.co.ukEasy to set up, and allows different server locations.Visitors may not know whether the prefix means a language or a country.
Subdirectoryexample.co.uk/de/Easy to set up and low in maintenance on one host.Harder to separate sites, and visitors may not tell what is targeted.
URL parametersexample.co.uk/page?loc=deNothing worth noting.Google's guidance does not recommend them. They are hard to segment.
09

How does hreflang work with canonical tags?

They answer different questions. A canonical tag picks one address among duplicates. Hreflang links versions that are meant to be different, because they serve different readers. Google notes that localised pages count as duplicates only when the main content stays untranslated, and its canonical guidance lists reciprocal hreflang references among the signals it weighs.

Google's hreflang page does not spell out how to combine the two, and we could not find a definitive statement. Our own practice is cautious: each version carries a canonical tag naming itself, and the hreflang set links the versions. We do not point every version's canonical at one language, because that tells Google the other versions are copies, which contradicts the annotations.

Treat that as our recommendation rather than a Google rule. Labels that describe the page, such as structured data, follow the same discipline: say only what is true of that exact version. The wider principle, which Google does state, is not to mix signals: if your canonical tags, redirects and sitemap name different addresses, expect Search Console to report duplicates. Why a site is not indexed explains how to read those reports when a language version goes missing.

The point

Labels that describe the page, such as structured data, follow the same discipline: say only what is true of that exact version.

10

What are the most common hreflang errors?

The commonest errors are missing return links, invalid codes, addresses that are not fully qualified, and automatic redirects that stop Google reaching a version. Most are mechanical, and almost all can be found by a crawl that reads every annotation and checks it against its partner.

ErrorWhat happensHow to fix it
Missing return linksGoogle ignores the tags if the other page does not point back.Make every version list every version, including itself, and generate the set from one list.
Using UK instead of GBGoogle ignores the region part of the annotation, so the tag does not target the United Kingdom.Write en-GB.
A region with no languageThe code is invalid.Put the language first, as in en-GB.
Relative or partial addressesAlternate addresses must be fully qualified, including http or https.Write the full address of every version.
Translating only the boilerplateIf the main content stays untranslated, Google treats the pages as duplicates.Translate the main content, or do not claim a separate language version.
Redirecting visitors automatically by language or locationSearch engines and users may never reach some versions. Googlebot mostly crawls from the US and sends no language header.Link between versions with ordinary links and let the visitor choose.
Using all three methods at onceNo search benefit, and three places to keep correct. Contradictions between them cause confusion.Choose HTML, headers or the sitemap, and keep to it.
Leaving annotations on removed pagesA set that lists an address that no longer loads cannot be reciprocal.Update the whole set when any page is added, moved or removed.
11

How do you check that hreflang is set up correctly?

Check hreflang by reading the annotations, not by waiting for rankings to change. Crawl the site, extract every set, and confirm that each address returns a normal page, lists itself and is listed by every partner. Spot-check a pair of pages by hand, and repeat after any release.

  • Pick one page that exists in every version and read the source of each. The set of lines should be identical on all of them.
  • Confirm that every address in a set loads normally, without a redirect or an error, and is the version you want shown. Make sure none is blocked from crawling, as our robots.txt guide explains.
  • Confirm that each page lists itself, and that every other page in the group lists it back.
  • Check every code against ISO 639-1 and ISO 3166-1 Alpha 2, looking for UK, EU and region-only values.
  • Confirm that you are using one method only. If annotations come from both HTML and the sitemap, decide which is the source of truth.
  • Use Search Console to see how the pages are indexed, and treat unexpected duplicates as a sign the signals disagree. What an SEO audit includes shows where this check sits in a wider review.
  • Re-run the check after a migration or a platform change, since annotations are easily lost when templates are rebuilt. The SEO migration checklist lists where, and website maintenance is where the recurring check can sit.
12

What does Prabhu Solutions do about hreflang?

Prabhu Solutions is registered in Oldbury, West Midlands, works with businesses across the UK and delivers remotely. Hreflang sits inside its technical SEO for UK businesses work as one of the checks on international and multi-language sites, and in its international SEO service, where we write the specification and test it by crawl rather than assuming it shipped as written. See what is involved before deciding whether you are ready.

We do not promise that hreflang will lift traffic, and we will tell you plainly when it is too early. A business with one UK market and no translated pages does not need it. This guide does not cover translation or localisation, and we make no claim about any particular language or market. We can say whether your annotations are consistent and what to change. If you are choosing who should do that, how to choose an SEO agency lists what to ask, and an SEO audit is the usual first step.

If you are looking at SEO marketing in Birmingham or elsewhere in the UK for a site that is about to add a market, describe the plan and we will say whether the structure or the annotations are the first thing to settle. Our Birmingham area page explains how remote delivery works for firms in the region. Page speed across versions is a separate matter, covered in the Core Web Vitals guide.

The point

Our Birmingham area page explains how remote delivery works for firms in the region.

13

Sources

Every statement about Google's behaviour on this page comes from Google Search Central documentation, read and checked on the date shown. The advice on pairing hreflang with canonical tags is our own recommendation and is labelled as such in the text.

  • Google Search Central, Tell Google about localized versions of your page (developers.google.com/search/docs/specialty/international/localized-versions): purpose, when to use, three methods, return links, self-reference, fully qualified URLs, x-default, language and region codes, common mistakes, Google not using hreflang or the lang attribute to detect language. Checked 24 October 2026.
  • Google Search Central, Managing multi-regional and multilingual sites (developers.google.com/search/docs/specialty/international/managing-multi-regional-sites): URL structure options, separate URLs rather than cookies, avoiding automatic redirects, not adapting content by IP address. Checked 24 October 2026.
  • Google Search Central, How to specify a canonical URL (developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls): redirect, canonical tag and sitemap signals, not mixing signals, hreflang clusters as a canonical signal. Checked 24 October 2026.

Questions people ask about this

What is hreflang in simple terms?

It is a label that tells Google which pages are the same content in different languages or for different regions. Google uses the labels to show searchers the most suitable version. Every version lists all the versions, including itself, and each page must link back to the others for the tags to be used.

Does hreflang help my site rank higher?

Google describes hreflang as a way to point people to the most appropriate version of a page by language or region. It does not describe it as a ranking boost. Its value is in showing the right version to the right searcher. Treat any claim that hreflang raises positions on its own as unsupported.

Do I need hreflang for a UK-only website?

No, if the site has one language and one set of pages for one market. Hreflang links equivalent versions of a page, and a single version has nothing to link to. You need it when you publish translations, or regional variants of the same language, such as pages for the UK, Ireland and the US.

Should I use en-GB or en-UK?

Use en-GB. Hreflang region codes follow ISO 3166-1 Alpha 2, and the code for the United Kingdom is GB. Google states that using UK in hreflang annotations has no effect, which means a tag written as en-UK loses its region and does not target British searchers.

Do hreflang tags need to be reciprocal?

Yes. If page X points to page Y, page Y must point back to page X, and each page should also list itself. Google states that if two pages do not both point to each other, the tags will be ignored. The same full set of annotations should appear on every version.

What does x-default do?

It names the fallback page for visitors whose language or region matches none of your specified versions, such as a language selector or your main site. Google describes it as the reserved value used when no other language or region matches the user's browser setting. It is optional but useful.

Should I put hreflang in the HTML, a header or the sitemap?

Pick whichever suits your site. Google treats the HTML link elements, the HTTP header and the XML sitemap as equivalent, and says using all three adds maintenance with no search benefit. HTML suits most pages, headers suit files like PDFs, and sitemaps suit large sites where editing page heads is impractical.

Can I redirect visitors to their language automatically?

Google recommends against automatically redirecting people from one language version to another, because it can stop users and search engines reaching every version. It also advises against adapting content by IP address. Add ordinary links to the other versions and let the visitor choose.

Does hreflang replace canonical tags?

No. They do different jobs. A canonical tag chooses one address among duplicates, while hreflang connects versions meant for different audiences. Google does not set out one fixed way to combine them, so our practice is to give each version a canonical naming itself and use the hreflang set to link them.

The work behind this article

Read next