The hreflang XML sitemap guide for international SEO

Aug. 01, 2013 | by Kevin Ellen

International brands occasionally have the wrong regional visibility for their website. This is often because one domain has more authority over the regional domain, or that the right domain has not been clearly specified to the search engines. As a result, the search engine cannot identify which domain is relevant to which region. For example, this would be the equivalent of an American website (.com) taking visibility priority over a German website (.de) in Germany.

Users are more inclined to convert and spend more time on your website when they are being served in their own currency and language. Recent tests have shown that the indexation rate has increased by around 150% after the implementation of an international sitemap.

International Domains

Different kind of website structures

There are various different set ups for international websites, the most common three being:

  • Country Specific TLD (ccTLD) – such as .de, .nl and .co.uk
  • Subdomain – such as de.example.com, nl.example.com and uk.example.com
  • Subfolder Structure – such as example.com/de, example.com/nl and example.com/uk

These three different methods for internationalisation can be split in two different groups:

  1. Same brand and information, but a different domain (which applies for the ccTLD and subdomain structures)
  2. Same brand and information, on the same domain (which applies for the Subfolder structure)

The rules for these different groups are indeed different and shall be discussed in this document.


Language and Region Specification

Every language should be specified in ISO 639-1 format. The region is optional, but when specified it should be in ISO 3166-1 Alpha 2 format. If the region is not specified, the language will be overruling. For instance, German (de) would be applicable to all German speaking users, whereas de-at (AT being Austria) would be applicable to German speakers in Austria. When the website has sections for various countries with the same language, the region-specific targeting is recommended.

For language script variations, the proper script is derived from the country. For example, when using zh-TW, the language script is automatically derived (in this example: Chinese-Traditional). You can also specify the script itself explicitly using ISO 15924.

At the moment there is no officially recognised code for Europe (EU) yet, so when the whole of Europe is targeted, just a language should be specified.


Rules of a Sitemap

A sitemap should not be larger than 50MB in size and contain more than 10,000 URL’s. They can be split into different sitemaps and defined in a sitemap-index. The characters in the URLs should be encoded, meaning an ampersand (&) would become &. This counts for all special characters. More information on this can be found here: https://support.google.com/webmasters/answer/35653?hl=en


Robots.txt

At iCrossing we recommend our clients to have sitemaps (or sitemap-index) defined in the robots.txt for the ease of the bots to find the appropriate sitemap. The URL to the sitemap should be in absolute format. An example including the syntax is:

Sitemap: http://www.example.com/sitemap.xml


Sitemap Index

When multiple XML Sitemaps are required, a sitemap-index is recommended to let the search engines know where to find the other sitemaps. The sitemap-index file is straight forward and will have a heading and only direct (absolute) links to the other sitemaps. An example of this is below:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>http://www.example.com/sitemap-1.xml</loc></sitemap>
<sitemap><loc> http://www.example.com/sitemap-2.xml </loc></sitemap>
<sitemap><loc> http://www.example.com/sitemap-3.xml </loc></sitemap>
</sitemapindex>

Top-line Structure XML Sitemap

Heading of the sitemap should be:

<?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">

Each URL should be specified in between the URL- nodes, as below:

<url>

<loc>http://www.example.com/de</loc>

<xhtml:link rel="alternate" hreflang="en" href="http://www.exmaple.com/en" />

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de" />

</url>

Each unique URL should have its own loc-node, as below:

<loc>http://www.example.com/</loc>

Each alternate version (including the URL itself) should be specified as follow within the URL-node:

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de" />

Each sitemap should end with the following tag:

</urlset>

Different Domains

Different domains can be achieved by using different regional subdomains or ccTLD’s (Country-Code Top-Level-Domains).  The XML Sitemap should have each of the current region URL specified in the loc-node with all the various other regions below it as an href-lang alternate with the appropriate language (and if applicable regional) code.

Example

<?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/de</loc>

<xhtml:link rel="alternate" hreflang="en-gb" href="http://www.exmaple.com/gb" />

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de" />

<xhtml:link rel="alternate" hreflang="en-us" href="http://www.exmaple.com/us" />

</url>

<url>

<loc>http://www.example.com/de/contact</loc>

<xhtml:link rel="alternate" hreflang="en-gb" href="http://www.exmaple.com/gb/contact " />

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de/contact " />

<xhtml:link rel="alternate" hreflang="en-us" href="http://www.exmaple.com/us/contact" />

</url>

</urlset>

Same Domains

When the regions are based upon the same domain through subfolders, the XML Sitemap will contain all the URLs with their respective alternations. This differs from the different domains sitemap, as that will only have URLs of that domain as a main URL. Every URL will have to be repeated in its full extent.

Example

<?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/de</loc>

<xhtml:link rel="alternate" hreflang="en-gb" href="http://www.exmaple.com/gb" />

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de" />

<xhtml:link rel="alternate" hreflang="en-us" href="http://www.exmaple.com/us" />

</url>

<url>

<loc>http://www.example.com/gb</loc>

<xhtml:link rel="alternate" hreflang="en-gb" href="http://www.exmaple.com/gb" />

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de" />

<xhtml:link rel="alternate" hreflang="en-us" href="http://www.exmaple.com/us" />

</url>

<url>

<loc>http://www.example.com/us</loc>

<xhtml:link rel="alternate" hreflang="en-gb" href="http://www.exmaple.com/gb" />

<xhtml:link rel="alternate" hreflang="de" href="http://www.exmaple.com/de" />

<xhtml:link rel="alternate" hreflang="en-us" href="http://www.exmaple.com/us" />

</url>

</urlset>
Be Sociable, Share!

    Comments (10)

    • Avis

      I simply couldn't leave your webste before suggesting that I really loved thee standard info an individual provide to your visitors?
      Is gonna be again continuously in order to check out new posts

      Also viseit my website :: will smith documentaryNov 20, 2014 02:21 am

    • Susanne

      Very soon this site will be famous amid all blogging and site-building visitors,
      due to it's good articles

      Take a look at my page; http://stopstreamtv.blogspot.com/Sep 21, 2014 07:09 pm

    • Hayattan sıkılmış web yazılımcının son kusmukları » E-ticaret siteleri için seo önerileri

      […] Farklı dil ve bölgeler için özel hazırlanan site haritalarını kullanın ve Google’a gönderin. (nasıl?) […]May 4, 2014 06:27 am

    • gabrio

      hey Kevi, i came across your post while i was checking one of my sites, and guess what, i think there's a discrepancy in GWT, i would like to hear your opinion, take a look at this and tell me what you think:

      so I have a sitemap with hreflang implementation, code is fine however I noticed that there's a discrepancy:

      From GWT, the sitemap passes validation if I have as xmlns:xhtml



      However, from a parsing point of view, when I load the sitemap in the browser, it looks all messed up with URLS jammed together.

      now, if instead I edit it to:



      then GWT gives this error Your Sitemap or Sitemap index file doesn't properly declare the namespace. Expected: http://www.w3.org/1999/xhtml Found: http://www.w3.org/TR/xhtml11/xhtml11_schema.html

      however, from a parsing point of view by opening in the browser (chrome, IE10 or FF), it appears correct.

      example part of my sitemap


      http://www.example/






      so, what's the deal? should I make google happy or parsing happy? CheersMar 7, 2014 03:43 pm

    • Jared

      For a large website of 40K pages with about 5K pages translated into different languages, what is the best approach for XML sitemaps? Would it be ok to have multiple XML sitemaps, while having one of them using HREFLANG for the multilingual pages?Mar 1, 2014 08:35 pm

    • E-ticaret Sitelerinin Trafiğini Arttıracak 100 SEO Önerisi « Bona Petite

      [...] Farklı dil ve bölgeler için özel hazırlanan site haritalarını kullanın ve Google’a gönderin. (nasıl?) [...]Feb 21, 2014 10:13 am

    • 100 Seo proposal that will increase the traffic of e-commerce pages | Webpagesinfo.com

      [...] Use site maps prepared for different languages and regions and send them to Google. (how?) [...]Feb 19, 2014 08:03 pm

    • E-ticaret sitelerinin trafiğini arttıracak 100 SEO önerisi | Erikyerik

      [...] Farklı dil ve bölgeler için özel hazırlanan site haritalarını kullanın ve Google’a gönderin. (nasıl?) [...]Feb 18, 2014 05:58 pm

    • E-ticaret sitelerinin trafiğini arttıracak 100 SEO önerisi | E-ticaret Uzmanı & Sosyal Medya Uzmanı l Aydın MENEK

      [...] Farklı dil ve bölgeler için özel hazırlanan site haritalarını kullanın ve Google’a gönderin. (nasıl?) [...]Feb 17, 2014 02:56 pm

    • Yunus Emre Eken >>Ataşehir Bilgisayar Servisi

      [...] Farklı dil ve bölgeler için özel hazırlanan site haritalarını kullanın ve Google’a gönderin. (nasıl?) [...]Feb 17, 2014 12:00 am

    • E-ticaret sitelerinin trafiğini arttıracak 100 SEO önerisi

      [...] Farklı dil ve bölgeler için özel hazırlanan site haritalarını kullanın ve Google’a gönderin. (nasıl?) [...]Feb 16, 2014 12:16 pm

    • Kevin Ellen

      Hi Nihal, Thanks for this! Am sure the team and I will be looking at this, as this enthusiasts me. We have noticed the failures in browsers whilst rendering hreflang-XML sitemaps, but we have not noticed anything negative in regards to performance of such files.Aug 2, 2013 04:36 pm

    • Nihal Nambiar

      Just one thing - the XHTML declaration sometime does not work so instead of using xmlns:xhtml="http://www.w3.org/1999/xhtml" you should use xmlns:xhtml="http://www.w3.org/TR/xhtml11/xhtml11_schema.html".

      Tip by http://stackoverflow.com/users/2532650/datahell over at http://stackoverflow.com/questions/16798979/xsd-for-sitemap-with-hreflangAug 2, 2013 04:27 pm

    • Kevin Ellen

      Hi Nick, we have seen an increase in the indexation rate after having applied the Hreflang sitemap across the entire site. We have been looking into potential differences between XML sitemap with Hreflang implementations compared to the on-page link element implementation. However, personally I prefer to use the XML sitemap, as I do not want to stuff the HTML header with an additional 10-15 links (for bigger projects the number can be considerably higher).Aug 2, 2013 03:23 pm

    • nick

      "Recent tests have shown that the indexation rate has increased by around 150% after the implementation of an international sitemap."

      150% compared to what? sites with no hreflang tagging, or those that use the hreflang tag in the html link element in the header?Aug 1, 2013 06:44 pm

     
    Please note: the opinions expressed in this post represent the views of the individual, not necessarily those of iCrossing.

    Post a comment

    SUBSCRIBE