How To Specify Multiple Sitemaps With Robots.txt

Specifying multiple sitemaps with robots.txt is actually pretty easy. It involves creating a simple sitemap index file… Instead of using sitemap: in your robots.txt file to point to each sitemap, you can use it to point to the index file.

The indexes are not hard to make, here is a really basic one:

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

Apparently you can also use the “lastmod” option to let the SE know when each sitemap was last updated, but I see no reason to use it.

Save the index file, then all you have to do is put “Sitemap: http://www.example.com/sitemapindex.xml” into your robots.txt file and you’re done.

Here is a link to Google’s official page on sitemap index files.

Please subscribe, or else I will cry. Do you really want to make a programmer cry?

One Comment

  1. Top 3 Best SEO Tips You’ll Ever Hear Says:

    […] /page/… pages. You can view mine here, in case you want an example. After that I created a sitemap index file and included both sitemaps in it and submitted that to Google, Yahoo, […]

Leave a Reply

Note: By submitting your comment you agree to this blog's comment policy.

If you want a little icon next to your name - sign up for one at Gravatar.