Multiple Sitemaps

Yes you can have multiple sitemaps for your site. Create the sitemaps you need, and then specify them in your robots.txt file. For example, here are the robots.txt directives for the two sitemaps used here at Perishable Press:

Sitemap: http://perishablepress.com/sitemap-perish.xml
Sitemap: http://perishablepress.com/sitemap-press.xml

That’s really all there is to it. Compliant search engines do a good job of keeping track of everything, just include the URLs of your sitemap(s) at the end of your site’s robots.txt file. Search engines like Google, Bing, and others will take it from there.

If you want to list more than 50,000 URLs, you must create multiple Sitemap files. — sitemaps.org

Webmaster Tools

If you use Google Webmaster Tools, remember to log in and specify your sitemap(s). Likewise for any other services you might be using for sitemaps, statistics, and SEO.

Google XML Sitemaps

If you’re using the incredibly awesome Google XML Sitemaps plugin for WordPress, multiple sitemaps aren’t possible, but you can specify an alternate path/name for your sitemap.

There seems to be a bug in version 3.2.4 of the plugin where the Automatic detection of a custom-named sitemap fails with an error. But really not a big deal because there is also an option for choosing a Custom location, as seen in this screenshot:

[ Screenshot: Settings for Google XML Sitemaps ]

So to specify a custom name for your sitemap, just use the custom location and you’re all set. Is there good a WordPress plugin for auto-generation of multiple sitemaps? Yes, it’s called Better WordPress Google XML Sitemaps, and it includes sitemapindex and MultiSite support.

Roll Your Own Sitemap Index

If you’re using multiple sitemaps, you should create a Sitemap Index that lists each of them. As instructed by sitemaps.org, create a blank XML file named something like sitemap-index.xml. In it, place the following code:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>http://perishablepress.com/sitemap-perish.xml.gz</loc>
  </sitemap>
  <sitemap>
    <loc>http://perishablepress.com/sitemap-press.xml.gz</loc>
  </sitemap>
</sitemapindex>

Replace the <loc> values with the locations of your sitemaps. Then instead of listing and linking to all of your sitemaps individually, you can just refer to your Sitemap Index. For example, here is the robots.txt directive for the Sitemap Index used at Perishable Press:

Sitemap: http://perishablepress.com/sitemap-index.xml

Note that a Sitemap Index file can only specify Sitemaps that are found on the same domain. In most cases, you can just list multiple sitemaps in your robots.txt file and be done with it. If you would like to consolidate things into a single URL, then creating a Sitemap Index is the way to go.

Essential Resources