Charles Herrera
Charles Herrera

Reputation: 21

SEO: order of hreflang elements in xml sitemap

I have been working on a major project to implement hreflang markup for an international site. Due to the site's complexity, I decided to go with the method of putting the relevant markup in the XML sitemap, even though I am more of a normal HTML guy. My sitemaps look something like the below example excerpt:

<url>
    <loc>http://www.example.com</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
    <xhtml:link href="http://www.example.com" hreflang="x-default" rel="alternate" />
    <xhtml:link href="http://www.example.ca" hreflang="en-ca" rel="alternate" />
    <xhtml:link href="http://www.example.co.uk" hreflang="en-gb" rel="alternate" />
    <xhtml:link href="http://www.example.com" hreflang="en-us" rel="alternate" />
    <xhtml:link href="http://www.example.mx" hreflang="es-mx" rel="alternate" />
</url>

etc.

I have already fully implemented some sitemaps, and yet Google Webmaster Tools doesn't seem to pick up on the fact that I have implemented hreflang. I am at a loss to figure out what is going on; the sitemaps for each of my test sites were indexed by Google and the syntax looks right to me, but admittedly I am new to XML. One theory I am thinking of is that for some reason the hreflang markup is getting just outright ignored due to something being off with the way it is constructed, but I have yet to figure out a way of determining this on my own.

I have done a good amount of research on Google trying to find the answer to this, but have come up empty so far, so I thought I'd ask directly: does XML care about the order of these elements?

Upvotes: 2

Views: 606

Answers (1)

bmiljevic
bmiljevic

Reputation: 782

The order is not important. Hreflang is a hint, not a directive. Google doesn't have to accept it. It usually takes some time for Google to crawl and index everything properly.

Please, provide a real link to your sitemap, so we try to help you with more details. Not enough info here.

Be sure to specify the xhtml namespace as follows: xmlns:xhtml="http://www.w3.org/1999/xhtml"

Upvotes: 1

Related Questions