10

I have a bi-lingual website with a sitemap index for each language that links to several different sitemaps (one for videos, one for static content, and one for articles). I would like to introduce another sitemap that links the sitemap indexes, so I could link that sitemap in the robots.txt in the root and wouldn't have to have one robots.txt for each language.

Is that valid? Or is there a simpler solution to my problem?

10

I'm not sure if this changed over the years since this was asked; while in theory you can (as the first answer states), in practice Google at least will give you an error (as seen in their Webmaster Tools):

Incorrect Sitemap index format: Nested Sitemap indexes

The Google help page further states:

A sitemap index file can't list other sitemap index files, but only sitemap files.

Source: https://support.google.com/webmasters/answer/35738

  • The important thing is sitemap vs sitemap index. I've made this error in the past. An index contains multiple sitemaps - that is the only way one of these types can contain another sitemap/index file. The documentation could be clearer imho. – winwaed Feb 17 '15 at 14:41
8

Yes, you can have a sitemap index containing references to other sitemap indexes [source], as long as they're all on the same domain.

Updated: Sitemap index files can't contain other index files – each sitemap index can contain links to regular sitemaps. Multiple sitemap indexes can be submitted to Google individually, though.

Each individual sitemap index can include up to 1,000 references to another <sitemap>. If you need to reference more than that, create multiple sitemap indexes and submit each one.

Each individual sitemap can include up to 50,000 page references. If you need more than that, split them across multiple sitemaps.

  • Could you please provide example of nested sitemap index ? I can't find it anywhere. The link you referenced is unfortunately dead. – expert Dec 21 '16 at 11:42
  • @expert All the above links are loading for me. The sitemap index advice is here: sitemaps.blogspot.com/2005/08/using-sitemap-index-files.html. You could also try archive.org: web-beta.archive.org/web/20151104084324/http://… – Nick Dec 21 '16 at 11:58
  • Oddly web archive says the page is not indexed. I was able to see it in Google cache. But I don't see how I refer to another sitemap. Could you please specify which tag/attribute of sitemap index I should use to point to another sitemap index? – expert Dec 21 '16 at 12:01
  • @expert It now looks like you can no longer user sitemap indexes in other sitemap indexes – I see reports that it results in a validator error in Webmaster Tools. So they would need to be separate: “Since Sitemap index files can't contain other index files, you would need to submit each Sitemap index file to your account separately.” webmasters.googleblog.com/2006/10/…. Will update the answer above. – Nick Dec 21 '16 at 12:28
  • The documentation states that you can reference 50,000 sitemaps from a site map index file: > If you do provide multiple Sitemaps, you should then list each Sitemap file in a Sitemap index file. Sitemap index files may not list more than 50,000 Sitemaps and must be no larger than 50MB (52,428,800 bytes) and can be compressed. You can have more than one Sitemap index file. The XML format of a Sitemap index file is very similar to the XML format of a Sitemap file. webmasters.stackexchange.com/questions/18243/… – Bennidhamma Sep 6 '18 at 21:09
0

There is an easier way but only if your web hosting package allows it.

Why not create subdomains for each language?

Each subdomain can then be pointed to a separate folder then basically, you copy everything so both folders are identical, then you change the contents of the newly presentation pages (for example, index.html) to match the different language.

For example, if you have a setup like this:

URL: http://www.example.com

Document root of above URL: /home/user/public_html

Contents of document root:

index.html
index.css
sitemap.xml
robots.txt

Then you can plan a setup like this:

URL: http://fr.example.com

Document root of above URL: /home/user/french/public_html

Contents of document root:

index.html
index.css
sitemap.xml
robots.txt

Then you'd only change index.html.

BUT...

If you used absolute pathnames in some of your scripts, then you need to change those as well. so in the above example, if the copy of index.html refers to index.css in the original folder, then that needs to be updated.

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.