1

This questions is basically a duplicate of hreflang tags in sitemaps - your site has no hreflang tags, which got no responses, so I'm asking myself in turn.

I'm not using HREFLANG tags in my HTML; instead, I'm putting them all in an XML sitemap, which is:

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>http://www.example.com/</loc>
     <xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/en/" />
     <xhtml:link rel="alternate" hreflang="fr" href="http://www.example.com/fr/" />
    <xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/de/" />
     <xhtml:link rel="alternate" hreflang="es" href="http://www.example.com/" />
  </url>
  <url>
    <loc>http://www.example.com/quienessomos/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/en/quienessomos/" />
     <xhtml:link rel="alternate" hreflang="fr" href="http://www.example.com/fr/quienessomos/" />
    <xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/de/quienessomos/" />
     <xhtml:link rel="alternate" hreflang="es" href="http://www.example.com/quienessomos/" />
  </url>
  <url>
    <loc>http://www.example.com/comofunciona/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/en/comofunciona/" />
     <xhtml:link rel="alternate" hreflang="fr" href="http://www.example.com/fr/comofunciona/" />
     <xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/de/comofunciona/" />
     <xhtml:link rel="alternate" hreflang="es" href="http://www.example.com/comofunciona/" />
  </url>
  <url>
    <loc>http://www.example.com/contact/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/en/contact/" />
     <xhtml:link rel="alternate" hreflang="fr" href="http://www.example.com/fr/contact/" />
     <xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/de/contact/" />
     <xhtml:link rel="alternate" hreflang="es" href="http://www.example.com/contact/" />    
  </url>

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

</urlset>

This sitemap has been there for months without issues: a week ago, though, Google Search Console has started warning me saying that there are "no return tags" errors. It says that there are 4 errors in the "en" version:

It then says that there are the same 4 errors in the "fr" version. Oddly enough, the "de" version only shows one error, for the root URL ("/" -> "http://www.example.com/de/").

I understand the idea that HREFLANG tags should be bidirectional. What I don't understand is how to implement that when I'm putting the tags in an XML sitemap. Should I add new entries such as the following for every alternative language and page or what?

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

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

(etc., etc.)

1 Answer 1

2

in short: yes. You last example is correct. Each sitemap URL, which is <loc>, should have its hreflang counterparts (if any).

3
  • I followed your advice and added those additional tags to my sitemap, and then submitted it. I've been waiting for a few weeks until Google picks up the new sitemap, but... it still says the same. and my new sitemap has definitely been processed already. :-(
    – PaulJ
    Mar 21, 2016 at 18:58
  • 1
    Can happen. Thats why bidirectional hreflang implementation should be better implemented directly in the site's source code - from there the search console takes hreflang relations much better, faster and exacter as from sitemap. But never mind - if you are sure, that your sitemap contains correct hreflang relations, then with time the search console will show it too. There are too many instances (datacenters, indexes etc.) at Google, which should be synced to show all data correctly. Thats why some improvements could become visible in some months.
    – Evgeniy
    Mar 22, 2016 at 16:48
  • Well, I looked yesterday again and now it only shows 2 bad HREFLANG errors, so I guess the only solution was to be patient... :-(
    – PaulJ
    Mar 29, 2016 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.