14

I have more than 5 subdomains on a project, say developer, www, staff and some more, what is the best practice in creating sitemaps?

All subdomains that share a same sitemap at base domain (example.com/sitemap.xml) ? or different sitemaps for different subdomains?(developer.example.com/sitemap.xml and www.example.com/sitemap.xml)

Since the subdomains are several parts of the main application, what are the pros and cons of each, and what should I consider while choosing the one over the other? (one sitemap per subdomain or one for the whole site)

4 Answers 4

13

Generally, you have to use a separate sitemap for each host (i.e., different protocol, domain, or subdomain):

  • From the FAQ "Where do I place my Sitemap?":

    All URLs listed in the Sitemap must reside on the same host as the Sitemap. For instance, if the Sitemap is located at http://www.example.com/sitemap.xml, it can't include URLs from http://subdomain.example.com. If the Sitemap is located at http://www.example.com/myfolder/sitemap.xml, it can't include URLs from http://www.example.com.

  • The relevant section from the Sitemaps spec is "Sitemap file location", where it says:

    Note that this means that all URLs listed in the Sitemap must use the same protocol (http, in this example) and reside on the same host as the Sitemap. For instance, if the Sitemap is located at http://www.example.com/sitemap.xml, it can't include URLs from http://subdomain.example.com.

However, if you can prove ownership of all hosts via robots.txt or Google Search Console, you can host the sitemaps on different hosts:

3
  • 1
    It seems that if they are all running off the same Google Verification (all listed in same Google Console, confirming you're the same owner) Google actually seems to make an exception according to: support.google.com/webmasters/answer/75712?hl=en Then it appears it is okay for sitemaps for any of those sites to reference each other. At least, that is the impression I get from Google Support website. This is an exception to normal sitesmaps.org rules. Aug 11, 2018 at 17:48
  • 1
    @MarkRejhon: Thanks for the info :) I updated the answer, and also listed another way (from sitemaps.org protocol) that allows sitemaps hosted on different hosts.
    – unor
    Aug 11, 2018 at 18:50
  • but if sitemap on example.com can it include example.com ?
    – zb'
    Jun 4, 2021 at 4:33
9

As per Matt Cutts blog post, he said:

A subdomain can be useful to separate out content that is completely different. Google uses subdomains for distinct products such news.google.com or maps.google.com, for example.

This is similar to what Blogger (blogspot) does.

John's blog (john.blogspot.com) is totally different from Doe's blog (doe.blogspot.com). Google sees these two blogs as two different sites even though they share the same tail (*.blogspot.com).

Each of these blogs have their own sitemap and are not shared between one another. If one blog gets deleted, the sitemap file will be deleted as well - and it does not affect the other blogs' sitemaps.

So, I'd like to recommend to you to use different sitemap files for different sub-domains. Unless you're using sub-directories/sub-folders.

2
  • 2
    I don't believe this answers the question of where sitemaps should be served from.
    – Dogweather
    Sep 15, 2016 at 21:07
  • 1
    "I'd like to recommend to you to use different sitemap files [...]" This statement is incorrect. You do NOT have a choice. Different websites require you to have different sitemaps. Feb 10, 2019 at 7:15
3

As you write the subdomains are part of the whole application there is no need to separate the sitemaps. Google treats subdomains as own domains ayways. But they are smart enough to recognize if parts of a website belong together.

Besides SEO I'd recommend to use an index-sitemap.xml in which you can nest all your separate subdomain-sitemaps. This makes it easier to manage all those files, as you only need to submit one single sitemap. Further you can change a subdomain's sitemap without having to worry about all the other sitemaps. Read more about managing multiple sitemaps on Googles Webmaster Guides: https://support.google.com/webmasters/answer/75712?hl=en

edit

You may take into consideration to create a single property for each subdomain in Google Search Console. This enables you to have more detailed analysis as you will receive data samples and crawling statistics for each property. If you do so I'd recommend to submit an individual sitemap for each subdomain. Be aware that this will require you to verify each property separately and also increase the effort it takes to manage the whole set of properties.

If you're a well organized person and interested in deeper data insights I'd recommend the latter. If you just wand your site to be indexed and crawled properly I'd recommend the index-sitemap story to you.

Always keep in mind to make sure all you sitemaps are configured accurately, matching the standard and deliver only pages that serve a 200 status code. This point is more critical to your website's SEO than the question of how many sitemaps you have.

0

I have more than 5 subdomains on a project, say developer, www, staff and some more, what is the best practice in creating sitemaps? ... Since the subdomains are several parts of the main application, what are the pros and cons of each, and what should I consider while choosing the one over the other? (one sitemap per subdomain or one for the whole site)

Since sub-domains attached to the main domain can represent different websites to the world, you're best to setup Sitemaps for each sub-domain for easiest accessibility.

Additionally, I believe its against the rules of Sitemaps to include an external link in a Sitemap belonging to a website, and a URL that contains a different sub-domain counts as an external URL.

As for best practice, if your website has a huge number of links, you'll want to make a master Sitemap file that references smaller Sitemap files where each of them references the individual links. This is because each Sitemap file has a maximum file size limit (of I think 50MB) and also the maximum number of URLs per Sitemap are also limited. I think that number is 50,000.

It is a bonus if you can compress the Sitemaps in gzip format. That way, when you submit them to gzip compliant search engines such as Google, then the Sitemap will be processed faster and the bandwidth consumption on the server will be lower.

Here are links related to sitemaps that may help you more:

http://www.sitemaps.org/protocol.html http://www.sitemaps.org/faq.html

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.