Free SEO audit for new clients — claim yours
Home/Learn SEO/Chapter 5: Technical SEO/International SEO and Hreflang
Chapter 5 · Lesson 38 of 65

International SEO and Hreflang

Learn how to serve different countries and languages: choosing a URL structure, writing correct hreflang tags and avoiding location-based redirects that hide pages from Google.

By Rohit Choudhary · 8 min read · Updated October 2026

Say you sell in the United States and the United Kingdom, or you have a Spanish version of your site for customers in Mexico. A common worry is: "Will Google think my pages are duplicates? How does it know which version to show to whom?" Then someone mentions "hreflang," and it sounds like something only developers understand.

It isn't. In this lesson, I will explain the difference between targeting a language and targeting a country, how to choose a URL structure for international versions, what hreflang tags do and how to write them, and why automatic redirects based on location usually backfire. By the end, you will be able to plan an international setup and check whether your hreflang tags are correct.

Language targeting or country targeting: which do you need?

Google's guide to managing multi-regional and multilingual sites separates two ideas:

  • A multilingual site offers content in more than one language, for example English and French.
  • A multi-regional site targets users in different countries, for example the US and Australia, even if both are in English.

A site can be both. A Canadian store with English and French pages, plus a separate US version, is multilingual and multi-regional.

Ask yourself one question: what actually changes between versions? If it's only the language, target by language. If prices, currency, shipping, phone numbers or laws change, you need country versions too. Here is how that looks in practice (these are invented examples):

BusinessWhat differsTarget by
A recipe blog with English and Spanish articlesOnly the languageLanguage (en, es)
An online shop selling in the US and UKCurrency, prices, shipping, spellingLanguage + country (en-US, en-GB)
A software company with German, French and Italian pages for SwitzerlandLanguage, but same countryLanguage + country (de-CH, fr-CH, it-CH)
A local plumber in one cityNothingNo international setup needed

If you are in that last row, you can skip most of this lesson and read the one on local SEO basics instead.

How does Google work out a page's language?

This surprises many people. Google says it uses the visible content of the page to determine its language. It doesn't use code-level language information such as the lang attribute or the URL. So the best signal is simple: write each page fully in one language, including the menu and buttons, and avoid side-by-side translations on the same page. Machine-translated pages that nobody has reviewed are also risky, as you learned in the lesson on helpful content.

Which URL structure should you choose for international versions?

Each language or country version needs its own URL. Google lists four main options. Here is how they compare:

StructureExampleProsCons
Country-code domain (ccTLD)example.deClear country signal; server location doesn't matterCostly; more sites to run; targets only one country
Subdomainde.example.comEasy to set up; can use different serversUsers may not know if "de" means language or country
Subdirectory (subfolder)example.com/de/Easy to set up; low maintenance; one site to manageOne server location; harder to separate sites
URL parameterexample.com?loc=deNone worth havingGoogle says this is not recommended

For most small and medium businesses, I suggest subdirectories. They are cheap, simple, and keep all your content under one domain, so you manage one site in Search Console and one set of links. A ccTLD makes sense when you run truly separate local businesses in each country, with local teams and budgets.

Besides the URL, Google looks at other country signals such as hreflang, local addresses and phone numbers, the currency you show, links from local sites and your Business Profile. It ignores "geo" meta tags such as geo.position. My longer post on international SEO goes deeper into strategy, and if you sell products abroad, read cross-border ecommerce as well.

Do you have to translate every page?

No. You don't need a version of every page for every market. Start with the pages that matter most to customers in that country, such as your homepage, main service or product pages, pricing and contact page. A smaller set of well-written local pages is better than hundreds of rushed translations. You can add more as the market proves itself.

Also keep in mind that Google isn't the leading search engine everywhere. In a few countries, local engines have a big share of searches, and they have their own rules. If you target one of those markets, read my post on Baidu, Naver, Yandex and Seznam before you plan your setup.

What is hreflang and how does it work?

Hreflang is an annotation that tells Google, "This page has other versions in other languages or for other countries, and here they are." Google then tries to show each searcher the version that fits their language and location. Without it, a searcher in the UK might land on your US page with dollar prices.

Think of hreflang as a signpost at a crossroads. Each version of the page carries the same signpost, pointing to every other version and to itself.

Here is an example for a page with US English, UK English and Spanish versions. The same block goes in the <head> of all three pages:

<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="es" href="https://example.com/es/precios/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/" />

Google's localized versions guide sets out the rules. Let me put them in plain words:

  1. Every version lists itself and all the others. The set of tags should be identical on each version.
  2. Links must go both ways. If page A points to page B but B doesn't point back to A, Google ignores those tags. These are called return links.
  3. Use full URLs. Include https:// and the domain. A relative URL like /uk/pricing/ doesn't work.
  4. Use the right codes. The language comes first, using ISO 639-1 codes (like en, es, de). An optional region follows, using ISO 3166-1 Alpha 2 codes (like us, gb, mx).
  5. Never use a country alone. hreflang="gb" is wrong; it must be en-gb. A common slip is en-uk, which is also wrong, because the code for the United Kingdom is gb.
  6. Add x-default for everyone else. The x-default value tells Google which page to show when no version matches the user's language, often a language selector or your main version.

Three ways to add hreflang

Google accepts hreflang in three places, and treats them as equal:

  • HTML link tags in the page's head, as in the example above. Best for most sites.
  • HTTP headers, useful for non-HTML files such as PDFs.
  • Your XML sitemap, handy for large sites, since it keeps the tags out of the page code. See the lesson on XML sitemaps.

Pick one method. Using all three only adds work and more chances for mismatches. For more examples and edge cases, read my post on hreflang tags.

How hreflang and canonical tags work together

Each language or country version should have a canonical tag pointing to itself, not to the "main" version. If your UK page says its canonical is the US page, you are telling Google the UK page is a duplicate, which works against your hreflang. Very similar pages, like US and UK English pages, may still be treated as duplicates; adding real local differences such as prices, spelling and contact details helps.

Why automatic redirects by location cause problems

Many sites check a visitor's IP address (their rough location) or browser language and instantly redirect them to a "matching" version. It feels helpful, but Google advises against it. Its guide says, "Don't use IP analysis to adapt your content," and recommends against automatically redirecting users based on what you think their language is.

There are two reasons. First, IP location is unreliable: a Spanish speaker in London or someone on a VPN gets the wrong version and may not be able to switch. Second, Googlebot itself has a location. Google's page on locale-adaptive pages explains that Googlebot's default IP addresses appear to be US-based and that it doesn't send an Accept-Language header. If your site always redirects US visitors to the US version, Google may never see your other versions.

A locale-adaptive page is one URL that changes its content based on the visitor's location or language. Google's recommendation is clear: use separate URLs for each locale and connect them with hreflang. If you want to guide visitors, show a small banner like "Looks like you're in Canada. Visit our Canadian site?" and let them choose. My post on why IP-based redirects hurt SEO walks through safer alternatives.

Try it: check the hreflang on one of your pages

If your site has more than one language or country version, here is a short exercise you can do right now:

  1. Open one page that has translations, for example your pricing or main service page.
  2. Right-click and choose "View page source," then search for hreflang.
  3. Write down every URL and code you find. Check each code: language first, optional country second, no country on its own.
  4. Check that the page lists itself among the versions.
  5. Open each of the other versions and check that they carry the same set of tags, pointing back.
  6. Click each URL in the tags to make sure it loads (no 404s or redirects) and that its canonical tag points to itself.

Note any mismatch. On a small site, this manual check is enough. On a bigger site, a crawler that reports hreflang errors will save you hours.

Questions beginners ask about international SEO and hreflang

Is translated content duplicate content?

No. A page in Spanish and its English original are different content for different readers. Very similar pages in the same language, like US and UK English, are a closer call, which is why hreflang and real local differences help.

Do I need hreflang if my site is only in one language?

Not if you target one country. If you target several countries in the same language with separate pages, such as en-us and en-gb, hreflang helps Google show the right version in each country.

Which is better for SEO: a ccTLD or a subfolder?

Both can work. A ccTLD sends a clear country signal but costs more to run. Subfolders are simpler and keep everything on one domain, which is why many businesses start there.

Does hreflang make my pages rank higher?

Hreflang helps Google show the right version to the right audience. It doesn't make a weak page rank better; it swaps in the most suitable version.

What does x-default mean?

It marks the fallback page for users whose language or region doesn't match any of your versions. Many sites point it to a language selector page or their main international version.

One site, many audiences, clear signposts

In brief, decide first whether you are targeting languages, countries or both. Give each version its own URL, usually in subfolders, and write each page fully in one language. Connect the versions with hreflang tags that are complete, reciprocal and use correct codes, plus an x-default. And let visitors choose their version instead of forcing redirects based on location.

In the next lesson, we cover site migrations, which is exactly what happens when you change domains or restructure a site, including when you add international folders. If you are planning to expand into new countries and want help with the setup, you can talk to our team.

Sources for this lesson on international SEO and hreflang

  1. Tell Google about localized versions of your page — Google Search Central
  2. Managing multi-regional and multilingual sites — Google Search Central
  3. How Google crawls locale-adaptive pages — Google Search Central

Rather have experts handle your SEO?

Tell us about your website and goals, and we will send you a free, no-obligation custom plan.

CallFree Quote