XML sitemaps support rel=alternate tag
Apologies for the lack of posting in the past month, I’ve been so busy and have just come back from a wonderful weekend in the Cotswolds with my wife. But enough about that – you’ve come here to read about a new way to setup your alternate content through an XML sitemap. Google recently blogged about a new standard and method to setup rel=alternate tags through your XML sitemap. Here we’ll do some testing as we did with the original rel=alternate blog to show you how it works – also for cross domain setup.
Updated: July 16th 16:59pm
Google’s Pierre Far blogged in the week about integrating rel=alternate tags with XML sitemaps and we’re going to test it right now.
The Test
I’m going to dump this code into a blank file that will target a US audience. I will keep it as similar as possible, although the whole idea is that you should be able to cater one page for a particular audience (so currency, phone numbers…).
<url>
<loc>http://www.seo-trench.com/2012/05/29/google-now-supports-rel-alternate-tag-in-xml-sitemaps</loc>
<xhtml:link
rel=”alternate”
hreflang=”en-gb”
href=”http://www.seo-trench.com/2012/05/29/google-now-supports-rel-alternate-tag-in-xml-sitemaps” />
<xhtml:link
rel=”alternate”
hreflang=”en-us”
href=”http://www.seo-trench.com/lang/us/xml-sitemap-rel-alternate.html” />
</url>
<url>
<loc>http://www.seo-trench.com/lang/us/xml-sitemap-rel-alternate.html</loc>
<xhtml:link
rel=”alternate”
hreflang=”en-us”
href=”http://www.seo-trench.com/lang/us/xml-sitemap-rel-alternate.html” />
<xhtml:link
rel=”alternate”
hreflang=”en-gb”
href=”http://www.seo-trench.com/2012/05/29/google-now-supports-rel-alternate-tag-in-xml-sitemaps” />
</url>
Now, Pierre only stated two languages, rather than regions, so this will be a great test to see if this is works or not. The US version will also have a canonical tag pointing back to this page. Let me know if you have any questions and I’ll post the results in a couple of weeks.
It works! Below are the test results and annotations:
![]()
A search from a UK IP returns the canonical version:

A search from a US IP returns a US version:
