Google Now Support 'rel-alternate-hreflang' Annotations in Sitemaps

Google Webmaster Central today adding support for specifying the rel-alternate-hreflang annotations in Sitemaps. "Using Sitemaps instead of HTML link elements offers many advantages including smaller page size and easier deployment for some websites," posted Pierre Far, Webmaster Trends Analyst."Announced in December last, these annotations define a cluster of equivalent pages that target users around the […]

Google Webmaster Central today adding support for specifying the rel-alternate-hreflang annotations in Sitemaps. "Using Sitemaps instead of HTML link elements offers many advantages including smaller page size and easier deployment for some websites," posted Pierre Far, Webmaster Trends Analyst.

"Announced in December last, these annotations define a cluster of equivalent pages that target users around the world in many languages and, optionally, countries and were implemented using rel-alternate-hreflang link elements in the HTML of each page in the cluster," Far said.

To see how this works, in the example below, "for the URL http://www.example.com/en, targeting English language users, the equivalent URL targeting German language speakers http://www.example.com/de. Up till now, the only way to add such annotation is to use a link element, either as an HTTP header or as HTML elements on both URLs," explains Far. As of today, you can now alternately use the following equivalent markup in Sitemaps.

Note, the new Sitemaps tags shown in bold function in the same way as the HTML link tags, with both using the same attributes.

The full technical details of how the annotations are implemented in Sitemaps, including how to implement the xhtml namespace for the link tag, are in the Help Center article.

<link rel="alternate" hreflang="en" href="http://www.example.com/en" >
<link rel="alternate" hreflang="de" href="http://www.example.com/de" >
<url>
  <loc>http://www.example.com/en</loc>
  <xhtml:link 
    rel="alternate"
    hreflang="de"
    href="http://www.example.com/de" />
  <xhtml:link
    rel="alternate"
    hreflang="en"
    href="http://www.example.com/en" />
</url>
<url>
  <loc>http://www.example.com/de</loc>
  <xhtml:link
    rel="alternate"
    hreflang="de"
    href="http://www.example.com/de" />
  <xhtml:link
    rel="alternate"
    hreflang="en"
    href="http://www.example.com/en" />
</url>