4

Under my Google Search Console I'm receiving a 'es' - no return tags (sitemaps) error for:

  • Originating URL: /en/about-us/testimonials
  • Alternate URL: /es/about-us/testimonials

And I have my sitemap XML file setup like the following:

<url>
  <loc>https://www.example.com/en/about-us/testimonials</loc>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/about-us/testimonials" />
  <lastmod>2016-07-11T00:00:00Z</lastmod>
  <priority>0.8</priority>
</url>
<url>
  <loc>https://www.example.com/es/about-us/testimonials</loc>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/about-us/testimonials" />
  <lastmod>2016-07-11T00:00:00Z</lastmod>
  <priority>0.8</priority>
</url>

However, should I also be including the following hreflang="en" in my sitemap XML file to avoid this issue?

<url>
  <loc>https://www.example.com/en/about-us/testimonials</loc>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/about-us/testimonials" />
  <lastmod>2016-07-11T00:00:00Z</lastmod>
  <priority>0.8</priority>
</url>
<url>
  <loc>https://www.example.com/es/about-us/testimonials</loc>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/about-us/testimonials" />
  <lastmod>2016-07-11T00:00:00Z</lastmod>
  <priority>0.8</priority>
</url>

1 Answer 1

1

Yes, you need to include both languages for each entry in the sitemap: the url you are specifying in the loc item and every alternate language version of the page.

Also the hreflang="x-default" is used only for auto-redirecting homepages or selectors, so in your case it seems that both pages have a specific language: en and es, it should be written with hreflang="en" instead of x-default like this:

<url>
  <loc>https://www.example.com/en/about-us/testimonials</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/about-us/testimonials" />
  <lastmod>2016-07-11T00:00:00Z</lastmod>
  <priority>0.8</priority>
</url>
<url>
  <loc>https://www.example.com/es/about-us/testimonials</loc>
  <xhtml:link rel="alternate" hreflang="en" href="https://www.example.com/en/about-us/testimonials" />
  <xhtml:link rel="alternate" hreflang="es" href="https://www.example.com/es/about-us/testimonials" />
  <lastmod>2016-07-11T00:00:00Z</lastmod>
  <priority>0.8</priority>
</url>
4
  • Ok, thank you...I thought for x-default I had to include this in my Sitemap XML so Google knows to use this page as the default page for all other languages that I don't have translations for? So for example, if I didn't have French listed in my Sitemap XML it would show French users my x-default link in the Google France search engine?
    – olimits7
    Jul 13, 2016 at 18:00
  • @olimits7 x-default is used when the page doesn’t target a specific language or locale, so it would be helpful if you have a generic https://www.example.com/. In this case you have the content in two languages, if you enter a query search in English, in Google France, it would return the English version of the web page.
    – marcanuy
    Jul 13, 2016 at 20:13
  • Ok, my website doesn't have a generic example.com , if you type that in to my site you get redirected to example.com/en ; so this is my default site. So should I change x-default to en in my Sitemap XML? Or should I add another line in my Sitemap XML pointing to the same URL for both x-default and en? Ty.
    – olimits7
    Jul 13, 2016 at 20:17
  • I would just change the x-default for en, not using x-default. Then send the sitemap to webmaster tools to verify it.
    – marcanuy
    Jul 13, 2016 at 20:29

Your Answer

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

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