Optimizing for Multilingual Content – Version 2.0 a Google Language Update
rel="alternate" hreflang="x" annotations in sitemaps

In December, Google announced a markup for multilingual content with the purpose of helping multilingual/multi-regional web sites better serve the correct language and/or regional URL for users worldwide. The rel=”alternate” hreflang=”x” in the HTML of each page (or HTTP header for non-HTML files) allows webmasters to define a cluster of equivalent pages targeting different languages and locations.

Then on May 24, Google announced its support of the rel=”alternate” hreflang=”x” annotations in sitemaps.

Note: For full details about the markup for multilingual content, check out our point-of-view on Google’s Markup for Multilingual Content: rel=”alternate” hreflang=”x”.

Until now, the only way webmasters were using the rel=”alternate” hreflang=”x” annotations was as an HTML element (or as an HTTP header for non-HTML files) where they would specify the language, the country (optional, although we advise to use it), and the appropriate URL for each specific region using the following structure:

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

Based on webmaster feedback and other considerations, Google expanded its support to allow webmasters to submit the rel=”alternate” hreflang=”x” annotations in sitemaps.

How-to:
Imagine you own the following pages:
http://www.example.com/pageA/ – targeting English speakers
http://ca.example.com/pageA/ – targeting English speakers in Canada
http://mx.example.com/pageA/ – targeting Spanish speakers in Mexico

    In the same way webmasters need to specify the language, country and URL when using rel=”alternate” hreflang=”x” annotations as an HTML element, similarly, they will still be required to specify these attributes when submitting the annotations in sitemaps. As a result, your sitemap may look similar to the snippet below. By specifying these attributes, Google will be better equipped to consolidate signals for all pages, thus rendering a more consistent and relevant URL in each Google country top level domain. Consequently, this can potentially increase conversion, reduce bounce rates, and improve the overall user experience.

    <?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> http://www.example.com/pageA/</loc>

    <xhtml:link

    rel=”alternate”

    hreflang=”en-ca”

    href=”http://ca.example.com/pageA/”

    />

    <xhtml:link

    rel=”alternate”

    hreflang=”es-mx”

    href=”http://mx.example.com/pageA/”

    />

    <xhtml:link

    rel=”alternate”

    hreflang=”en”

    href=”http://www.example.com/pageA/”

    />

    </url>

    <url>

    <loc>http://mx.example.com/pageA/</loc>

    <xhtml:link

    rel=”alternate”

    hreflang=”en-ca”

    href=”http://ca.example.com/pageA/”

    />

    <xhtml:link

    rel=”alternate”

    hreflang=”en”

    href=”http://www.example.com/pageA/”

    />

    <xhtml:link

    rel=”alternate”

    hreflang=”es-mx”

    href=”http://mx.example.com/pageA/”

    />

    </url>

    <url>

    <loc>http://ca.example.com/pageA/</loc>

    <xhtml:link

    rel=”alternate”

    hreflang=”en”

    href=”http://www.example.com/pageA/”

    />

    <xhtml:link

    rel=”alternate”

    hreflang=”es-mx”

    href=”http://mx.example.com/pageA/”

    />

    <xhtml:link

    rel=”alternate”

    hreflang=”en-ca”

    href=”http://ca.example.com/pageA/”

    />

    </url>

    </urlset>

    Note: When using this approach, you must specify the xhtml namespace as shown above (third line of code) and define a separate cluster of equivalent URLs per each individual URL (including itself).

    In conclusion, we have identified several reasons why it is more advantageous to submit rel=”alternate” hreflang=”x” annotations in sitemaps, as opposed to incorporating them as an HTML element. The primary advantage appears to be that by choosing to relocate this information from the HTML file to the sitemap, the HTML file remains smaller – positively impacting page load time, which champions the user experience and the overarching SEO campaign. Another reason we see value in using the sitemap for submissions can simply be attributed to ease-of-use. The implementation using sitemaps will most likely be far less complex; who wouldn’t rather update a single sitemap file as opposed to each individual HTML page?

    This technique is representative of one more undertone used to aid Google in rendering the most relevant results. Google aggregates all signals and ultimately renders the most relevant pages based on the user’s location and language. That said, we don’t recommend using this method on a standalone basis.  Rather, it should be one of the elements incorporated into all international SEO campaigns, especially since Bing has yet to adopt this approach.