Skip to main content
improved explanation
Source Link
marcanuy
  • 2.7k
  • 15
  • 24

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>

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 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>

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>
Source Link
marcanuy
  • 2.7k
  • 15
  • 24

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 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>