1

I have:

  • example.com/en/product-a-en
  • example.com/es/product-a-es
  • example.com/ru/product-a-ru

If i use this:

On-page Markup Use the lang attribute in the HTML tag: <html lang="en">

Use rel alternate links to the same page in other languages as suggested by Google:

<link rel="alternate" hreflang="en"
      href="http://www.example.com/en/product-a-en" />

<link rel="alternate" hreflang="es"
      href="http://www.example.com/es/product-a-es" />

<link rel="alternate" hreflang="ru"
      href="http://www.example.com/ru/product-a-ru" />

Should I send google sitemaps for each lang path example.com/lang-path? Or I just send English Sitemap subdirs (example.com/en/) and it will look at HTML and say, okey, it is multi-language and will make the sitemap for other languages alone?

I am asking because I have 17 languages and more than 2000 links.

Any idea how to make it best and easier way?

  • Note: the <link> tag does not use or need a closing slash and never has. – Rob Feb 23 '18 at 13:10
1

It's best to do it for every language. (see: hreflang: the ultimate guide on Yoast)

Here is a sitemap xml file for your example:

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

If you want, you can add x-default for languages not covered by your site.

<xhtml:link rel="alternate" hreflang="x-default" hreflang="http://www.example.com/en/"/>

You have to add this to all pages (inside the url tags).

  • If you want, you can add x-default for languages not covered by your site. – x21 Feb 23 '18 at 15:13
0

The way I see it, sitemap.xml is used to tell robots what URLs you want them to crawl the most. It helps Googlebot and other crawlers navigate your site in the way you want them to. If your priority is to crawl and index your alternate language pages then adding them to your sitemap over only English pages will help prioritize their crawling.

If you do not add them to your sitemap, Google should be able to discover and crawl your language alternate pages, especially if they are linked to without the rel="nofollow" attribute.

But if your sitemap currently has all English language pages and you want your alternate language pages to be crawled more frequently, you should strongly consider adding them to your sitemap. Because if you don't, Googlebot and other crawlers might decide to prioritize your English pages in your sitemap over your alternate language pages.

  • Do you proof that Google would not check all the pages at a similar level? I don't think I ever noticed a page being favored just because it appears in an XML sitemap. – Alexis Wilke Feb 10 at 2:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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