Skip to content

Toufiq SEO

International SEO

Hreflang Tags: A Practical Guide to Implementation and Common Errors

How hreflang works, correct syntax and codes, the return tag rule, x-default, implementation methods, canonical conflicts and how to test.

  • Updated
  • 5 min read
Desk globe representing multilingual and multi-country websites using hreflang tags
On this page
  1. What hreflang does, and what it does not do
  2. Hreflang syntax
  3. The return tag rule
  4. Using x-default
  5. Three ways to implement hreflang
  6. Hreflang and canonical tags
  7. Same-language markets
  8. Common hreflang errors checklist
  9. How to test hreflang
  10. When hreflang is not enough
  11. Frequently asked questions

Quick answer: Hreflang tags tell Google which language or regional version of a page to show each user. Every version must list all the others, including itself, using valid ISO language codes (and optional region codes), and every reference must be returned by the page it points to. Add an x-default for users who match no version, keep canonicals self-referencing, and implement through HTML link tags, HTTP headers or the XML sitemap.

Hreflang is one of the most error-prone parts of technical SEO. A single missing return tag can mean your UK customers see the US page with dollar pricing, or a whole market quietly stops receiving organic traffic. The rules are strict but learnable. This guide covers the syntax, the three implementation methods, the most common errors and how to test.

What hreflang does, and what it does not do

  • It does: help Google swap in the right language or country version of a page in search results for each user.
  • It does not: boost rankings by itself, translate pages, or override a canonical tag pointing elsewhere.
  • It is not needed for a single-language, single-market site.

Hreflang syntax

Each tag has two parts: the language-region value and the URL.

<link rel="alternate" hreflang="en-us" href="https://example.com/us/pricing/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/pricing/" />
<link rel="alternate" hreflang="de-de" href="https://example.com/de/preise/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/" />
RuleCorrectCommon mistake
Language code uses ISO 639-1en, de, es, freng, ger
Region code uses ISO 3166-1 alpha-2en-gb, es-mxen-uk, es-latam
Region cannot stand aloneen-ca, fr-caca (that means Catalan)
URLs are absolutehttps://example.com/de//de/
Each page references itselfSelf tag includedSelf tag missing

The return tag rule

Hreflang must be bidirectional. If the US page says the UK page is its alternate, the UK page must say the US page is its alternate. When the return link is missing, Google may ignore the pair. This is the most frequent hreflang failure on the sites I audit, usually caused by one template, one market or one CMS plugin that was configured differently from the rest.

Using x-default

x-default tells Google which page to show users whose language or region does not match any listed version. It is commonly the international homepage, a language selector or the main English version. It is optional but recommended for sites serving many markets.

Three ways to implement hreflang

MethodBest forTrade-offs
HTML link tags in the headSmall to medium sitesAdds code to every page; must be in the head, not the body
HTTP headersPDFs and non-HTML filesHarder to audit; requires server configuration
XML sitemapLarge sites with many versionsKeeps page code light; sitemaps must stay perfectly in sync

Pick one method per set of pages. Mixing methods makes conflicts more likely and harder to debug.

Hreflang and canonical tags

Each language or regional version should have a self-referencing canonical. A common error is canonicalizing all regional versions to one “main” version, for example every English page to the US URL. That tells Google the other versions are duplicates, and hreflang cannot overrule it. You will often see the affected pages listed under duplicate or alternate statuses in Search Console’s indexing report statuses.

Same-language markets

English for the US, UK, Canada and Australia, or Spanish for Spain and Mexico, are where hreflang matters most, because the pages are nearly identical. Make each version genuinely localized: currency, spelling, units, shipping information, contact details and local examples. Thin regional copies with only the currency swapped are more likely to be folded together.

Common hreflang errors checklist

  • Missing return tags between versions.
  • Invalid codes such as en-uk or region-only values.
  • Hreflang pointing to redirected, noindexed or 404 URLs.
  • Canonicals pointing to a different language or region.
  • Tags placed in the body or after invalid head elements, so they are ignored.
  • Relative URLs or mixed http and https versions.
  • Old URLs left in hreflang after a migration. Updating every reference must be part of any site migration checklist.

How to test hreflang

  1. Crawl the site with a tool that validates hreflang and reports missing return links and non-200 targets.
  2. For sitemap implementations, validate the sitemap and spot-check URL sets.
  3. Use URL Inspection to confirm Google indexed each version with its own canonical.
  4. Check Search Console performance by country to confirm each market’s pages receive impressions from the right country.

Hreflang checks belong in every technical audit checklist for multi-market sites, and should be rerun after any template change.

When hreflang is not enough

Hreflang solves which version appears, not whether a market has enough visibility. Ranking in a new country also depends on localized keyword research, local links and content that reflects how people in that market search. That broader work is the focus of our international SEO service. The same is true locally: a locksmith with a correct technical setup still needs a trusted profile, as I explain on my locksmith SEO page.

Frequently asked questions

Does hreflang improve rankings?

Not directly. It helps Google show the right version to the right users, which improves relevance, click-through and conversions in each market.

Do I need hreflang if my site is only in English?

Only if you have separate versions for different English-speaking countries. A single English site for all markets does not need it.

Is en-uk a valid hreflang code?

No. The correct ISO 3166-1 code for the United Kingdom is GB, so use en-gb.

Does Bing support hreflang?

Bing has historically relied more on the content-language meta tag and other signals. If Bing traffic matters in your markets, add a content-language declaration alongside hreflang.

Toufiq-ur Rahman Kobir
Written by

Independent SEO consultant

Top Rated on Upwork

Toufiq-ur Rahman Kobir is an independent SEO consultant with five years of agency and freelance experience, including SEO management for a Dallas agency where he led more than twenty webmasters, content managers and copywriters. He works on technical SEO, content strategy and AI search visibility for US and international businesses.

Experience
Five years, agency and freelance
Previously
SEO Manager, JP Marketing, Dallas
Focus
Technical SEO, content strategy, AI search
Status
Taking on a limited number of clients
Scroll to Top