Skip to main content

International SEO

The web is not in one language. Someone in Paris searches in French. Someone in Pune searches in Hindi or English. Someone in Lagos, Lima, or Lahore searches in their own words too, in their own way, with their own spellings, prices, and habits.

If your site speaks to more than one of them, international SEO is how you tell search engines (and browsers, and screen readers) which version is for whom. Done well, a reader sees your page in the right language. Done badly, a French reader lands on your English page, and a Hindi reader never finds your Hindi one at all.

This is the last lesson in the SEO section, and it ties together almost everything before it: titles, descriptions, canonical links, and Open Graph tags, all repeated, for every language.


What You Will Learn​

  • The difference between a language and a region
  • The lang attribute, and what it is for
  • How to use hreflang links, including x-default and return links
  • The right codes (and the common wrong ones)
  • How to choose a URL structure
  • How canonical, titles, and Open Graph fit with each version
  • Localisation beyond translation
  • How to check your setup

The Big Idea​

https://thebreadbin.example/recipes/rye-bread
<!doctype html>
<html lang="en">
<head>
<title>Rye Bread Recipe | The Bread Bin</title>
<link rel="canonical" href="https://thebreadbin.example/recipes/rye-bread">

<link rel="alternate" hreflang="en" href="https://thebreadbin.example/recipes/rye-bread">
<link rel="alternate" hreflang="en-GB" href="https://thebreadbin.example/uk/recipes/rye-bread">
<link rel="alternate" hreflang="fr" href="https://thebreadbin.example/fr/recettes/pain-de-seigle">
<link rel="alternate" hreflang="hi" href="https://thebreadbin.example/hi/rye-bread">
<link rel="alternate" hreflang="x-default" href="https://thebreadbin.example/recipes/rye-bread">
</head>

Edit the codes and addresses. Try the common mistakes, and watch the advice change.

Language, Region, and Script​

A language is what people speak and read. A region is where they live. They are not the same, and sometimes both matter.

CodeMeaningWhy you might separate them
enEnglish, any regionOne English version for everybody
en-GBEnglish for the United KingdomSpelling (colour), currency (pounds), units
en-USEnglish for the United StatesSpelling (color), currency (dollars)
pt-BRPortuguese for BrazilDifferent words and grammar from Portugal
zh-Hans and zh-HantChinese, simplified and traditional scriptDifferent writing systems
frFrench, any regionOne French version for everybody

You do not need a region for every language. Add one only when the content really differs, such as prices, laws, spelling, or shipping.

The codes​

  • Language: two or three lowercase letters, from the ISO 639 list (en, fr, hi, ja).
  • Region: two uppercase letters, from the ISO 3166-1 list (GB, US, IN, BR).
  • Script (rare): four letters with a capital first, such as Hans or Hant.
  • Separator: a hyphen, never an underscore: en-GB, not en_GB.
  • Region alone is not allowed. GB is not a code. You need the language: en-GB.

Common wrong codes: en-UK (it should be en-GB), jp (it should be ja), cz (should be cs), gr (should be el), ua (should be uk), and fr_FR with an underscore.

The lang Attribute​

<html lang="fr">

The lang attribute on the html element says what language the page is written in. It matters for:

  • Screen readers, which choose the right voice and pronunciation.
  • Browsers, for hyphenation, spell-check, quotation marks, and font choices.
  • Translation tools, which can offer or skip translation.
  • Styling, with the :lang() CSS selector.

Search engines mostly work out a page's language from its text, and do not rely on lang for it. So lang is not a ranking tool, but you should always set it, for people. For a passage in another language, put lang on that element:

<p>The French call it <span lang="fr">pain de seigle</span>.</p>

For right-to-left languages, add dir="rtl" as well: <html lang="ar" dir="rtl">.

hreflang: Pointing to Your Other Versions​

hreflang tells search engines: "This page has the same content in these other languages and regions, here are the addresses." They can then show each reader the version that matches them best.

<link rel="alternate" hreflang="fr" href="https://thebreadbin.example/fr/recettes/pain-de-seigle">

The rules​

  1. Include every version, including the page itself. The block is the same on every version.
  2. Return links are required. If the English page points to the French page, the French page must point back to the English page. Search engines usually ignore one-way links.
  3. Use full addresses, with https://.
  4. Use correct codes.
  5. Add one x-default, pointing to the version for readers who match none of the others (often the English page, or a language chooser).
  6. Use it for real alternatives only: pages with the same content in a different language or region. Do not link unrelated pages.
  7. Keep it consistent with your canonical links and sitemap.

Check the return links yourself:

http://127.0.0.1:5500/index.html

Each row is a page. Tick the versions that page lists in its hreflang links, including itself.

This page links to...English pageFrench pageHindi page
English page
French page
Hindi page

1 problem found.

  • The English page points to the Hindi page, but the Hindi page does not point back. Search engines may ignore this pair.

The rule: if page A says "B is my Hindi version," then B must say "A is my English version." These are called return links, and search engines usually need both sides before they trust the pair.

Three ways to add it​

MethodWhereGood for
Link tagsIn the head of each pageSmall and medium sites
HTTP headersSent by the serverPDFs and non-HTML files
SitemapIn your XML sitemapLarge sites, where editing every head is hard

Pick one method, and keep it correct. Mixing methods that disagree causes confusion. The Link element lesson has more on the tag itself.

hreflang is a hint

Like canonical, hreflang is a hint, not a command. Search engines may still show a different version. The better your content, signals, and consistency, the more likely they are to follow it.

Canonical and hreflang Together​

Each language version should have a canonical that points to itself, not to the English page:

<!-- On the French page -->
<link rel="canonical" href="https://thebreadbin.example/fr/recettes/pain-de-seigle">

If you point every translation's canonical to the English page, you are telling search engines to ignore the translations. See Canonical Links.

Pages in the same language for different regions (such as en-US and en-GB) can look nearly identical. That is fine, as long as the details (currency, spelling, shipping) really differ, and the hreflang links are correct.

Choosing a URL Structure​

StructureExampleGoodThink about
Country domain (ccTLD)thebreadbin.frA very strong signal for a countryCostly, and every site is separate
Subdomainfr.thebreadbin.exampleCan be hosted separatelyTreated as a separate site by some tools
Subfolderthebreadbin.example/fr/One site, simple to manageSame hosting for all
URL parameterthebreadbin.example/?lang=frEasy to buildNot recommended. Hard to read and crawl

For most sites, subfolders are the simplest and most practical choice. Whatever you choose, be consistent, and keep each language on its own stable addresses.

Translation and Localisation​

Translation changes the words. Localisation changes everything that people in a place expect.

  • Translate the whole page, including the title, description, headings, image alt text, buttons, and error messages. Do not mix languages on a page.
  • Use a good translation. Raw machine translation can be awkward or wrong. Have a native speaker review the pages that matter.
  • Research local words. People in different places search for the same thing with different terms. Translate the meaning, and check what locals actually type.
  • Show local formats: dates, times, numbers, currency, units, phone numbers, and addresses.
  • Check images and colours. Pictures, gestures, and symbols can mean different things in different places. Text inside images needs a version per language.
  • Support the language's needs: right-to-left layout for Arabic, Hebrew, Persian, and Urdu; fonts that include the right characters (Indic scripts, CJK); and room for longer or shorter text.
  • Use UTF-8 everywhere, so every character displays.
  • Offer local ways to pay and contact, where relevant.
  • Follow local rules about privacy, advertising, and consumer rights. This is not legal advice.

Make Each Version Complete​

Every version needs its own:

  • lang attribute.
  • Title and meta description, written in that language. See Title (SEO) and Meta Description.
  • Headings and content, not a copy of the English.
  • Open Graph and Twitter tags, with og:locale set, and og:locale:alternate for the others. See Open Graph.
  • Structured data, with inLanguage, if used.
  • Canonical link pointing to itself.
  • Sitemap entry.

A translated page that keeps its English title and description is only half translated.

Language Switchers and Redirects​

  • Use real links in your language switcher, so crawlers and people can follow them. See HTML SEO Basics.
  • Label each language in its own language: "Français," "हिन्दी," "العربية," not "French," "Hindi," "Arabic."
  • Do not force a redirect based on a visitor's location or language. Search engine crawlers usually visit from one place, so they may never see your other versions. And people travel, use a VPN, or speak a different language from the country they are in. Instead, suggest the right version with a banner, and let the person choose. Then remember their choice.
  • Do not hide content behind a language cookie. Every version should have its own address.

Local Search Engines and Signals​

  • Google and Bing are widely used, but Baidu (China), Yandex (Russia and nearby), Naver (Korea), and others matter in their regions. Each has its own guidelines and tools, and some do not use hreflang in the same way. Check the ones your readers use.
  • Country targeting. Search Console has had country-targeting settings for some site types. Check what is currently available.
  • Local signals such as a local domain, local hosting speed, local addresses and phone numbers, and local links all help a page seem relevant to that place.
  • Speed matters. A content delivery network (CDN) can serve your pages quickly from near your readers.

Check Your Setup​

http://127.0.0.1:5500/index.html

Check it for real​

  1. "View source" on each version, and search for hreflang.
  2. Make a table: every version, its address, its code, and the list of alternates it names. Check that the lists match.
  3. Search Console has reports and tools for international targeting. Check the current names.
  4. A crawler tool can check return links across a whole site.
  5. Search in each language, from each country if you can, and see which version appears.
  6. Ask native speakers to read each version.

Good Habits​

  • Set lang on every page, and dir for right-to-left languages.
  • Give every version its own address, stable and linked.
  • Use correct hreflang codes, include the page itself, and add x-default.
  • Check return links.
  • Point each version's canonical to itself.
  • Translate everything, including titles, descriptions, and alt text.
  • Localise formats, currency, images, and examples.
  • Suggest, do not force, a language.
  • Test with native speakers and real devices.

International SEO Checklist​

  • Every page has the right lang (and dir where needed)
  • Each language or region has its own stable address
  • hreflang links list every version, including the page itself
  • Return links exist in both directions
  • Codes are valid, hyphenated, and correctly capitalised
  • There is an x-default
  • Each version's canonical points to itself
  • Titles, descriptions, headings, alt text, and tags are translated
  • Open Graph tags have og:locale, with alternates
  • A language switcher with real links, labelled in each language
  • No forced redirects by location or browser language
  • Dates, currency, units, and formats are localised
  • A native speaker reviewed the key pages

Security and Privacy Notes​

  • Do not use hreflang with untrusted addresses. If an address in a link tag comes from user input or a database, an attacker could inject a link to a bad site, or break your HTML. Build the tags from fixed, validated data, and escape the output. The builder above does this.
  • Be careful with automatic language detection. Guessing a person's language or country from their address, or their browser, reveals something about them. Use it only to make a suggestion, collect no more than you need, and do not store it without a reason.
  • Language cookies and preferences can be personal data in some places. Tell people what you store, and give them a way to change it. This is not legal advice.
  • Different regions have different rules. Privacy laws (such as the GDPR in Europe), advertising rules, and consumer rights vary. A page for one country may have to say something different from another.
  • Do not block or cloak content by country in a way that shows crawlers something different from visitors. It can look like a trick, and may be penalised.
  • Check that private or draft translations are protected. Unfinished language versions on a public address can be found and indexed.
  • Beware of machine-translated spam. Auto-translated pages created in bulk, with no review, can be treated as low-quality, and a hacked site is sometimes filled with them. Check your site for languages you do not offer.

Global Audience Notes​

  • This whole lesson is about reaching a world audience, so remember the person behind every code. Behind hi is someone who may read your page on a small phone, on a slow connection, and in a script your design never tested.
  • Use real language names in your switcher, and let people change language from any page.
  • Do not assume one language per country. India, Switzerland, Canada, Belgium, and many others have several. A person's language is their choice, not their address.
  • Plan for text growth. German and Finnish words run long, and some languages run short. Test your layout with real translations.
  • Names, forms, and addresses differ widely. Do not require a "first name" and "last name," or a ZIP code, for everyone.
  • Fonts and encodings: use UTF-8, and a font family with fallbacks for each script you support.
  • Right-to-left pages need mirrored layouts, and care with numbers, icons, and mixed-direction text.
  • Time and calendars: show time zones, and consider local calendars where they matter.
  • Accessibility needs translation too. Alt text, labels, error messages, and captions in each language.
  • Test on real devices in real places, or with people who live there.

Common Mistakes to Avoid​

  1. No lang attribute, or the wrong one (English on a French page).
  2. Wrong codes: en-UK, jp, fr_FR, or a region alone.
  3. Missing return links.
  4. No self-reference in the hreflang list.
  5. Canonical pointing every translation to the English page.
  6. Translating the body but not the title, description, or alt text.
  7. Forcing redirects by location or browser language.
  8. Language chosen by a cookie or parameter, with no address of its own.
  9. Relative addresses in hreflang.
  10. Mixing hreflang methods that disagree.
  11. Raw machine translation with no review.
  12. Never checking the versions with native speakers.

Practice Time​

Try these in your browser and your editor:

  1. Use the hreflang builder with four versions. Then try en-UK, jp, fr_FR, and GB alone. What does it say about each?
  2. Switch the x-default to a different version. What changes in the tags?
  3. Use the return-link matrix. Fix the problem by hand, then try "Link every page to every page."
  4. Run the checker on the messy page, fix every problem, and run it again.
  5. Add lang to a page, and a lang on a phrase in another language. Listen to it with a screen reader if you can.
  6. Choose a URL structure for a site you imagine, and write down why.
  7. Translate a page title and description into a language you know, and check the length.
  8. Look at three multilingual sites. How do their language switchers work?
  9. Search for the same thing in two languages. Which version of a site appears for each?
  10. Bonus: build a three-language version of a one-page site, with correct lang, hreflang, canonical, and Open Graph tags for each.

Quick Recap​

Click a question to check your answer.

1. What is the lang attribute for?

It says which language the page is written in, so screen readers, browsers, and translation tools can behave correctly. It is for people and tools. Search engines mostly work the language out from your text.

2. What does hreflang do?

It tells search engines which other language or region versions of a page exist, and where, so each reader can be shown the best match.

3. What is a return link, and why does it matter?

If page A lists page B as an alternate, page B must list page A back. Search engines usually ignore one-way links.

4. What is x-default?

A fallback version for readers who match none of your listed languages or regions. It is often the main language page, or a language chooser.

5. Where should a translated page's canonical point?

To itself. Pointing every translation to the English page tells search engines to ignore the translations.

6. Why not redirect people automatically by their location?

Crawlers may never see the other versions, and people travel, use a VPN, or speak a different language from their location. Suggest a version, and let the person choose.

Key Takeaways​

  • Set lang on every page, for people and tools.
  • Use hreflang to link every version, including the page itself, with return links and an x-default.
  • Use correct codes: language in lowercase, region in capitals, joined with a hyphen.
  • Each version has its own address and its own self-pointing canonical.
  • Translate everything, including titles, descriptions, alt text, and tags, and localise formats.
  • Suggest, do not force, a language.
  • Subfolders are the simplest URL structure for most sites.
  • Test with native speakers, and remember the person behind every code.

You have finished the SEO section. Go back to the section overview, pick any lesson to revisit, and then check one of your own pages from title to hreflang.