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:
- Originating URL "/", alternative URL "http://www.example.com/en/"
- Originating URL "/comofunciona/", alternative URL "http://www.example.com/en/comofunciona/"
- Originating URL "/contact/", alternative URL "http://www.example.com/en/contact/"
- Originating URL "/quienessomos/", alternative URL "http://www.example.com/en/quienessomos/"
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.)