How2Lab Logo
tech guide & how tos..

Building multiple sitemaps for very large websites

On a single sitemap.xml file you can include maximum 50,000 URLs. Further, the sitemap file should not exceed 10 Mb in size. Compressing the file to overcome this limitation will not help. The uncompressed version should not exceed 10 Mb. Thus, when you have a significantly large website, multiple sitemaps come to your rescue.

As you know that a sitemap is essentially an index of your web pages. When you create multiple sitemaps, you group them all together using an index of indexes. And this index of indexes is referred as the sitemap index file.

The Sitemap index file contains reference to all your individual sitemap files. The XML format for a sitemap index file is syntactically similar to that of a sitemap file, except that instead of containing your web page urls, it contains urls of your sitemap files. And those individual sitemap files in turn contain your web page urls.

Basic format of the Sitemap index file

Sitemap Index File Format

Here is the explanation of the tags that you see in the above example.

The Sitemap index file

  • Begins with an opening <sitemapindex> tag and end with a closing </sitemapindex> tag. Remember that in a normal sitemap file, we used <urlset> instead.
  • Includes a <sitemap> entry for each individual sitemap file.
  • Within the <sitemap> tag pair, are the following entries:
    • A <loc> entry that contains the full url of the individual sitemap file.
    • A <lastmod> entry (optional) indicating when the individual sitemap file was last modified.

Note that you should not include any page urls in the sitemap index file. Also, all sitemap urls included in the sitemap index file must belong to the same domain and should be hosted within the same hosting account. If you have any special characters in your individual sitemap urls, make sure to escape it by enclosing the url within a CDATA section. (read about how to build a basic sitemap first before reading this article).

Where should you place your sitemap index file and all your individual sitemap files?

To keep matters simple, it is recommended that you place all your sitemap related files under the home directory of your website. Though there are other options available, which can be understood by digging deep into the concept of sitemaps.

Buy Domain & Hosting from a trusted company
Web Services Worldwide | Hostinger
About the Author
Rajeev Kumar
CEO, Computer Solutions
Jamshedpur, India

Rajeev Kumar is the primary author of How2Lab. He is a B.Tech. from IIT Kanpur with several years of experience in IT education and Software development. He has taught a wide spectrum of people including fresh young talents, students of premier engineering colleges & management institutes, and IT professionals.

Rajeev has founded Computer Solutions & Web Services Worldwide. He has hands-on experience of building variety of websites and business applications, that include - SaaS based erp & e-commerce systems, and cloud deployed operations management software for health-care, manufacturing and other industries.

Refer a friendSitemapDisclaimerPrivacy
Copyright © All rights reserved.