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: https://perishablepress.com/sitemap-perish.xml
Sitemap: https://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:
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>https://perishablepress.com/sitemap-perish.xml.gz</loc>
</sitemap>
<sitemap>
<loc>https://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: https://perishablepress.com/wp-sitemap.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.
9 responses to “Multiple Sitemaps”
Thanks for the awesome article! I wonder what the advantage for having multiple sitemaps is–other than listing more than 50k URLs. Could you give some examples where having multiple sitemaps might be better than having a single one? Is it better for SEO to have e.g. category specific or visitor group specific sitemaps?
@chris The only time to have multiple sitemaps is when you have more than 50,000 URLs to list or the file size is beyond 10MB.
There is no added benefit in creating multiple sitemaps because they don’t guarantee a site will be crawled and indexed, only that the URL exists.
Thanks! Learned something new!
The idea of multiple sitemaps is cool. I’m using the GD Press Tools plugin, and it allows me to create sitemap for post types (posts, pages, custom post types), taxonomies (categories, tags, custom taxonomies), … and add them into robots.txt file.
I think it’s a fast way to handle multiple sitemaps. Just one thing: it doesn’t help creating other type of custom sitemaps (I’m not using it, but Yoast has mentioned about this before on his blog)
Multiple sitemaps have it’s benefits when you have 1000s of URLs.
Nice article, BTW.
Chris one benefit of multiple sitemaps is having an .xml sitemap and also a Geositemap which is a .kml file if you have a static location for your business…
Hello
Thank you for the great post. One n00b question – what is the advantage of Geositemap and can you please refer a resource that I can use to understand Geositemaps.
Keep up the good work.!
Great article, explains everything really well – especially the roll your own section.
Personally, i always use them on bigger sites and/or CMS sites as it makes it easier to generate them dynamically if you split you content into distinct sections.
Hi, this come in time to me. I was just about to create a second sitemap, but, no I’ve learned something.
Thanks for sharing with us. Keep the good job.