SEO for Multi-language — i18n

Each language has its own URL; Google recommends a different URL per language, not cookies or browser settings. A subdirectory (/ja/), a subdomain and a…

Someone in Tokyo searches Google for a homestay in the mountains. Mrs. Sri wants her Japanese page to show up, and someone in Cairo to get the Arabic page. That's the job of multi-language SEO: getting each language version found by Google and shown to the right searcher. It works like the brochure rack at the local tourist information centre. Each version of the Mist Homestay brochure has its own slot in the rack, and each brochure prints "Also available in: English, Bahasa Indonesia, 日本語, العربية", with their slot numbers. The rack keeper (Google) only trusts that list when the two brochures name each other.

One language, one URL

The Google Search Central page "Managing multi-regional and multilingual sites" says: "Google recommends using different URLs for each language version of a page rather than using cookies or browser settings to adjust the content language on the page." Googlebot carries no language cookie, so a version that only appears through a cookie is one it never sees.

The structure options, with their pros and cons from the same page:

Structure Example Pros Cons
Country domain (ccTLD) misthomestay.jp The clearest country target, server location doesn't matter, sites cleanly separated Expensive (and not always available), more infrastructure, ccTLD rules sometimes strict, can only target one country
Subdomain ja.misthomestay.example Easy to set up, different server locations allowed, sites cleanly separated Users might not tell from the URL alone ("ja": language or country?)
Subdirectory misthomestay.example/ja/ Easy to set up, low maintenance (one host) Users might not tell from the URL alone, one server location, harder to separate
URL parameter misthomestay.example/?lang=ja Google writes "Not recommended"

Google doesn't crown one winner among the first three. For Mrs. Sri, a subdirectory makes the most sense: one domain, one hosting plan, one certificate, the least upkeep.

hreflang: every page lists every version, itself included

The tag <link rel="alternate" hreflang="..."> tells Google that the same page is available in another language. This is the Japanese page's <head>, with its URLs already encoded (the slug section explains why):

<link rel="alternate" hreflang="id" href="https://misthomestay.example/id/kamar-teras">
<link rel="alternate" hreflang="en" href="https://misthomestay.example/en/terrace-room">
<link rel="alternate" hreflang="ja" href="https://misthomestay.example/ja/%E3%83%86%E3%83%A9%E3%82%B9%E3%83%AB%E3%83%BC%E3%83%A0">
<link rel="alternate" hreflang="ar" href="https://misthomestay.example/ar/%D8%BA%D8%B1%D9%81%D8%A9-%D8%A7%D9%84%D8%AA%D8%B1%D8%A7%D8%B3">
<link rel="alternate" hreflang="x-default" href="https://misthomestay.example/en/terrace-room">

The rules, from the page "Tell Google about localized versions of your page":

An hreflang code says who the page is for, not its Intl locale. The format is an ISO 639-1 language code, optionally followed by an ISO 3166-1 Alpha 2 region code. Mrs. Sri has only one Arabic page for every Arabic speaker, so its code is ar, even though its numbers are formatted with ar-EG. ar-EG means "Arabic speakers in Egypt", so a guest in Riyadh (ar-SA) doesn't match and falls to x-default. Wrong codes: jp (JP is the country; Japanese is ja), en-UK (the United Kingdom's code is GB), and a region alone like eg: "You can't specify the country code by itself." Codes outside those two standards, like es-419, aren't supported either.

Canonical: each language points to itself

<link rel="canonical"> points to the main version among pages with the same content. A translation isn't a duplicate, so each language has its own canonical:

<!-- on /ja/テラスルーム -->
<link rel="canonical" href="https://misthomestay.example/ja/%E3%83%86%E3%83%A9%E3%82%B9%E3%83%AB%E3%83%BC%E3%83%A0">

If all four pages point to /en/terrace-room, Google is told that id, ja and ar are only copies of the en page, and it may show the en version to everyone. The page "How to specify a canonical URL with rel="canonical" and other methods" says: "If you're using hreflang elements, make sure to specify a canonical page in the same language, or the best possible substitute language if a canonical page doesn't exist for the same language."

Translated slugs

Language Path What is actually sent
id /id/kamar-teras the same
en /en/terrace-room the same
ja /ja/テラスルーム /ja/%E3%83%86%E3%83%A9%E3%82%B9%E3%83%AB%E3%83%BC%E3%83%A0
ar /ar/غرفة-التراس /ar/%D8%BA%D8%B1%D9%81%D8%A9-%D8%A7%D9%84%D8%AA%D8%B1%D8%A7%D8%B3

A sitemap with xhtml:link

Instead of putting 5 tags in every <head>, hreflang can live in the sitemap. Pick one method: HTML tags, an HTTP Link header (for files like PDFs), or the sitemap.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://misthomestay.example/id/kamar-teras</loc>
    <xhtml:link rel="alternate" hreflang="id" href="https://misthomestay.example/id/kamar-teras"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://misthomestay.example/en/terrace-room"/>
    <xhtml:link rel="alternate" hreflang="ja" href="https://misthomestay.example/ja/%E3%83%86%E3%83%A9%E3%82%B9%E3%83%AB%E3%83%BC%E3%83%A0"/>
    <xhtml:link rel="alternate" hreflang="ar" href="https://misthomestay.example/ar/%D8%BA%D8%B1%D9%81%D8%A9-%D8%A7%D9%84%D8%AA%D8%B1%D8%A7%D8%B3"/>
    <xhtml:link rel="alternate" hreflang="x-default" href="https://misthomestay.example/en/terrace-room"/>
  </url>
  <!-- three more <url> elements for en, ja and ar, each with the same five xhtml:link -->
</urlset>

Don't redirect automatically by language

The temptation: a guest whose browser is in Japanese opens /en/terrace-room and gets thrown to /ja/... at once. The page "Managing multi-regional and multilingual sites" says: "Avoid automatically redirecting users from one language version of a site to a different language version of a site. For example, don't redirect based on what you think the user's language may be." The page "How Google crawls locale-adaptive pages" explains why: "the default IP addresses of the Googlebot crawler appear to be based in the USA. In addition, the crawler sends HTTP requests without setting Accept-Language in the request header." If Mrs. Sri's server redirects every request without Japanese from /ja/ to /en/, Googlebot never sees the Japanese page.

What to use instead: a suggestion that can be closed, for example "このページは日本語でもご覧いただけます" ("this page is also available in Japanese") with a link to the Japanese version, plus the language picker from the previous lesson. A page whose URL already carries a language is always sent in that language.

⚠️ Mistakes that make Google pick the wrong version

TL;DR: Each language has its own URL; Google recommends a different URL per language, not cookies or browser settings. A subdirectory (/ja/), a subdomain and a country domain are all allowed, each with pros and cons, while a ?lang= parameter isn't recommended; for Mrs. Sri a subdirectory is the lightest. Each page carries <link rel="alternate" hreflang="..."> for every version including itself, plus x-default, with complete URLs, and the pairs must point to each other or they're ignored. An hreflang code names the audience (ar for every Arabic speaker, ar-EG for Egypt only; never jp, en-UK or eg). Each language's canonical points to itself. Translated slugs are stored per language and UTF-8 encoded. A sitemap can replace the HTML tags with xhtml:link, one <url> per language. Don't redirect automatically by IP or Accept-Language: Googlebot crawls from US IPs without that header.

⚡ One language, one URL

Meaning: Google recommends a different URL for each language, not cookies or browser settings. Googlebot carries no language cookie, so a version that only appears through a cookie is one it never sees. For Mrs. Sri, a subdirectory such as /ja/ is the lightest.

⚡ hreflang lists every version

Write:

<link rel="alternate" hreflang="en" href="https://misthomestay.example/en/terrace-room">
<link rel="alternate" hreflang="x-default" href="https://misthomestay.example/en/terrace-room">
Guess first: the en page points to ja, but ja doesn't point back. What does Google do?

It ignores the en and ja pair. The rule exists so another site can't claim to be a language version of your page.

Meaning: The tag <link rel="alternate" hreflang="..."> tells Google that the same page is available in another language. Every version lists every version, itself included, with complete URLs, plus x-default for guests whose language matches no version.

⚡ Canonical points to itself

Meaning: A translation isn't a duplicate, so each language's canonical points to itself. Don't redirect guests automatically by language either: Googlebot crawls from US IPs without an Accept-Language header, so it would only ever see one version.

What you will learn