Unifying content under multilingual templates

Thursday, September 09, 2010

If you have a global site containing pages where the:

  • template (that is, side navigation, footer) is machine-translated into various languages,
  • main content remains unchanged, creating largely duplicate pages,

and sometimes search results direct users to the wrong language, we'd like to help you better target your international/multilingual audience through:

<link rel=”alternate” hreflang="a-different-language" href="https://url-of-the-different-language-page" />

As you know, when rel="canonical" or a 301 response code is properly implemented, we become more precise in clustering information from duplicate URLs, such as consolidating their linking properties. Now, when rel="alternate" hreflang="x" is included in conjunction with rel="canonical" or 301 redirects, not only will our indexing and linking properties be more accurate, but we can better serve users the URL of their preferred language.

Sample configuration that's prime for rel="alternate" hreflang="x"

How does this all work? Imagine that you're the proud owner of example.com, a site called "The Network" where you allow users to create their very own profile. Let's say Javier Lopez, a Spanish speaker, makes his page at https://es.example.com/javier-lopez:

sample site called the network

Because you're trying to target a multilingual audience, once Javier hits "Publish," his profile becomes immediately available in other languages with the translated templates. Also, each of the new language versions is served on a separate URL.

Two localized versions, https://en.example.com/javier-lopez in English and https://fr.example.com/javier-lopez in French

Background on the old issue: duplicate content caused by language variations

The configuration above allowed visitors speaking different languages to more easily interpret the content, but for search engines it was slightly problematic: there are three URLs (English, French, and Spanish versions) for the same main content in Javier's profile. Webmasters wanted to avoid duplicate content issues (such as PageRank dilution) from these multiple versions and still ensure that we would serve the appropriate version to the user.

A new solution for localized templates

First of all, just to be clear, the strategy we're proposing isn't appropriate for multilingual sites that completely translate each page's content. We're trying to specifically improve the situation where the template is localized but the main content of a page remains duplicate/identical across language/country variants.

Before we get into the specific steps, our prior advice remains applicable:

  • Have one URL associated with one piece of content. We recommend against using the same URL for multiple languages, such as serving both French and English versions on example.com/page.html based on user information (IP address, Accept-Language HTTP header).
  • When multiple languages are at play, it's best to include the language or country indication in the URL, for example, example.com/en/welcome.html and example.com/fr/accueil.html (which specify en and fr) rather than example.com/welcome.html and example.com/accueil.html (which don't contain an explicit country/language specification). More suggestions can be found in our blog posts about designing localized URLs and multilingual sites.

For the new feature:

Select the proper canonical.

The canonical designates the version of your content you'd like indexed and returned to users. The first step towards making the right content indexable is to pick one canonical URL that best reflects the genuine locale of the page's main content. In the example above, since Javier is a Spanish-speaking user and he created his profile on es.example.com, https://es.example.com/javier-lopez is the logical canonical. The title and snippet in all locales will be selected from the canonical URL.

Once you have the canonical URL picked out, you can either:

  1. 301 (permanent redirect) from the language variants to the canonical. As an example, if a French speaker visits fr.example.com/javier-lopez (not the canonical), have this page include a cookie to remember the user's language preference of French. Then permanently redirect from fr.example.com/javier-lopez to the canonical at es.example.com/javier-lopez. Because of the cookie, es.example.com/javier-lopez will still render its boilerplate in French