Question: How many URLs can a sitemap include?

Answer

According to the Sitemap protocol, a single sitemap file should contain no more than 50,000 URLs and must be no larger than 50MB uncompressed. If your site has more than this, you'll need to create multiple sitemap files.

You can also group multiple sitemap files together by using a Sitemap index file. A sitemap index file can include up to 50,000 sitemaps and must not exceed 50MB (52,428,800 bytes). Uncompressed means the size of the sitemap when it's sent from your server in its uncompressed form.

Here is an example of what a simple sitemap might look like:

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/foo.html</loc> <lastmod>2023-01-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset>

If you need to create a sitemap index because your website has more than 50,000 URLs or your sitemap file exceeds the 50MB limit, here's an example of how a sitemap index file might look like:

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

In this example, each referenced sitemap will contain a list of URLs from your website.

Other Common Sitemap Questions (and Answers)

© ContentForest™ 2012 - 2024