hreflang explained: adding languages without duplicate content

When translated pages count as duplicates, what hreflang tells Google, the rules that trip people up, and a minimal example for a site in three languages.

When a site adds a second language, two worries come up. Will Google treat the translations as duplicate content? And will it show each searcher the right version? Google's documentation answers the first question directly, and for the second it offers hreflang, a small annotation that links the language versions of a page together.

Are translated pages duplicate content?

Not when the main content is translated. Google's page on localized versions says: "Localized versions of a page are only considered duplicates if the main content of the page remains untranslated."

Its canonicalization guide gives the other side. If only the header, footer and other secondary text are translated and the body stays the same, the pages count as duplicates. Same-language regional versions, such as an English page for the US and another for the UK, can also be near copies. For those, Google suggests using both a canonical tag and hreflang so it can tell which regional URL to show.

Google's guide to multilingual sites also recommends a single language for the content and navigation of each page, and advises against side-by-side translations.

What hreflang does

hreflang tells Google that several URLs are versions of the same content for different languages or regions. With that information, Search can point people to the version that matches their language or location.

hreflang doesn't tell Google what language a page is in. Google's guide to multilingual sites is explicit: "Google uses the visible content of your page to determine its language." Google ignores code-level signals such as the lang attribute, and it doesn't read the language from the URL either.

Google says it may find alternate language versions without hreflang, but that it is usually best to declare them explicitly.

Give each language its own URL

Google recommends separate URLs for each language version, instead of switching the language with cookies or browser settings on a single URL. Googlebot usually crawls from the United States and sends requests without an Accept-Language header, so versions that appear only for certain settings may never be crawled.

The URL structure is up to you. Google lists country-code domains, subdomains and subdirectories as options, each with its own pros and cons. For subdirectories such as example.com/pl/ it lists easy setup and low maintenance, since everything stays on one host.

The rules that trip people up

  1. Each language version must list itself and every other version. The set of links is identical on every version of the page.
  2. Links must go both ways. If the English page points to the Polish one, the Polish page has to point back, or Google may ignore the annotations.
  3. URLs must be fully qualified, including https://. Relative paths don't work.
  4. Codes must be valid: a language code in ISO 639-1 format, optionally followed by a region in ISO 3166-1 Alpha 2 format, such as en-GB. A region on its own is not valid, codes outside those standards such as es-419 aren't supported, and Google ignores the region part when it is a reserved code such as EU, UN or UK.
  5. Pick one method. Google supports HTML link elements, HTTP headers and sitemaps, treats them as equivalent, and says using all three brings no benefit in Search.
  6. In HTML, the link elements must sit inside a well-formed head section.

A minimal example

Say an article exists in English, Polish and German, with English as the fallback for everyone else. Each of the three pages carries the same four lines in its head:

<link rel="alternate" hreflang="en" href="https://example.com/blog/hreflang-guide/" />
<link rel="alternate" hreflang="pl" href="https://example.com/pl/blog/przewodnik-hreflang/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/blog/hreflang-leitfaden/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/blog/hreflang-guide/" />

The slugs can be translated, and the URLs don't need to follow the same pattern. Google also says alternate URLs don't have to be on the same domain. The last line uses x-default, the value for searchers whose language settings don't match any version listed.

Each version should also have a canonical tag pointing to itself. A canonical tag tells Google which URL represents a set of duplicate pages, so a Polish article whose canonical points to the English one asks Google to treat a translation as a copy.

The same thing in a sitemap

If you can't edit the head of your pages, or you have many of them, the sitemap method does the same job. Google's localized versions guide describes it like this: each URL gets its own entry, and each entry lists every language version of the page as a child link, including itself. Three versions of an article therefore mean three entries in the sitemap, each with the same three child links.

The HTTP header method exists for files that have no head section, such as PDFs. Whichever method you choose, use only that one, so you don't have two sets of annotations to keep in sync.

How to check your setup

Open each language version and look at the links in its head, or at the rendered HTML in Search Console's URL Inspection tool. The set should be complete, identical on every version, and should include the page itself.

Then follow a few links in both directions. A Polish page that lists the English version while the English page doesn't list the Polish one back is a missing return link, the first item on Google's list of common hreflang mistakes, and it can make Google ignore the annotations.

Check that each version is indexed under its own URL, and that its canonical points to itself. Finally, look at the Performance report in Search Console with the Countries dimension. If the Polish version is the one getting impressions from Poland, the setup is doing its job.

Adding languages gradually

You don't have to translate a whole site at once. Google's localized versions guide says that if keeping a complete set of links becomes difficult, you can leave some languages out on some pages, and Google will still process the pairs that point to each other. It adds that newly added language versions should link both ways with the original language of the site.

In practice, translate the main content along with the menu and footer, and have someone who reads the language check the pages that matter most. Add a language, check that its pages are indexed and linked correctly, and then add the next.

Ranketto also adds languages gradually. Content starts in the site's main language, and more languages are added one every 7 days, up to 14, so search engines are not flooded with new pages at once. The language versions and the sitemap are kept up to date as new articles arrive.

Questions and answers

Do I need hreflang if my site has only one language?

No. hreflang describes alternate language or regional versions of a page. If each page exists in one version only, there is nothing to annotate.

Does hreflang improve rankings?

Google describes it as a way to help Search point people to the most appropriate language or regional version of a page. Its documentation doesn't present it as a ranking boost.

Should a translated page's canonical tag point to the original article?

No. A canonical tag tells Google which URL represents a set of duplicates, and Google says properly translated pages aren't duplicates. Let each language version be its own canonical and connect the versions with hreflang.

What is x-default?

A fallback for searchers whose language settings don't match any version you list. Google says it was designed for language selector pages, though you can use it on any page.

Sources

  1. Tell Google about localized versions of your page
  2. Managing multi-regional and multilingual sites
  3. What is canonicalization
  4. How to specify a canonical URL with rel="canonical" and other methods
  5. URL Inspection tool
  6. Performance report (Search results): Overview and basic setup

Read next

See it work before you pay

ranketto.com runs on Ranketto too, and its Search Console numbers are public.

Sign-ups aren't open yet. Until then, you can follow ranketto.com's own Search Console numbers.