Split up your large sitemaps

If you have a sitemap that exceeds the size limits, you'll need to split up your large sitemap into multiple sitemaps. You can use a sitemap index file as a way to submit many sitemaps at once. The XML format of a sitemap index file is very similar to the XML format of a sitemap file. The sitemap index file uses the following XML tags:

  • sitemapindex - the parent tag surrounds the file.
  • sitemap - the parent tag for each sitemap listed in the file (a child of the sitemapindex tag)
  • loc - the location of the sitemap (a child of the sitemap tag)

You can see the Sitemap Protocol page for more information on syntax.

The following example shows a sitemap index in XML format that lists two sitemaps:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap1.xml.gz</loc>
  </sitemap>
  <sitemap>
    <loc>https://www.example.com/sitemap2.xml.gz</loc>
  </sitemap>
</sitemapindex>

Like sitemap files, sitemap index files must follow the same size limits and general sitemap guidelines.

Once you've made and saved your sitemap index file, you can submit your index file to Google. Make sure that you upload and save all the referenced sitemaps to the same site as your sitemap index file. Sitemaps that are referenced in the sitemap index file must be in the same directory as the sitemap index file, or lower in the site hierarchy. For example, if the sitemap index file is at https://example.com/public/sitemap_index.xml, it can only contain sitemaps that are in the same or deeper directory, like https://example.com/public/shared/.... You can submit up to 500 sitemap index files for each site in your Search Console account.

Manage sitemaps for multiple sites

If you have multiple websites, you can simplify the process of creating and submitting sitemaps by creating one or more sitemaps that include URLs for all your verified sites, and saving the sitemap(s) to a single location. All sites must be verified in Search Console. You can choose to use:

  • A single sitemap that includes URLs for multiple websites, including sites from different domains. For example, the sitemap located at https://host1.example.com/sitemap.xml can include the following URLs.
    • https://host1.example.com
    • https://host2.example.com
    • https://host3.example.com
    • https://host1.example1.com
    • https://host1.example.ch
  • Individual sitemaps (one for each site) that all reside in a single location.
    • https://host1.example.com/host1-example-sitemap.xml
    • https://host1.example.com/host2-example-sitemap.xml
    • https://host1.example.com/host3-example-sitemap.xml
    • https://host1.example.com/host1-example1-sitemap.xml
    • https://host1.example.com/host1-example-ch-sitemap.xml

To host cross-site sitemaps in a single location, you can either verify all sites in Search Console to prove ownership of each site that is referenced in the sitemaps, or specify individual sitemaps in each site's robots.txt file:

To submit sitemaps through Search Console:

  1. Make sure that you have verified ownership of all the sites.
  2. Create a sitemap that includes URLs from all the sites that you want to cover. You can create a single sitemap that includes URLs from all sites or you can create one or more separate sitemaps for each site.
  3. Using Google Search Console, submit your sitemap(s).

To specify sitemaps in each site's robots.txt file:

  1. Create sitemaps that include URLs from a single site.
  2. Upload all sitemaps to a single site you have control over, for example https://sitemaps.example.com.
  3. Reference the sitemap of each individual site from the respective robots.txt files. For example, if you created a sitemap for https://example.com/ and you're hosting the sitemap at https://sitemaps.example.com/sitemap-example-com.xml, reference the sitemap in the robots.txt file at https://example.com/robots.txt with sitemap: https://sitemaps.example.com/sitemap-example-com.xml.