2

I want to create a sitemap for Google and Bing.

Referring to sitemap protocol: https://www.sitemaps.org/protocol.html#sitemapXMLExample

I want to combine sitemap file and sitemap-index file in one. What I mean is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"

         xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

   <sitemap>

      <loc>http://www.example.com/sitemap-index-1.xml</loc>

      <lastmod>2004-10-01T18:23:17+00:00</lastmod>

   </sitemap>

   <sitemap>

      <loc>http://www.example.com/sitemap-index-2.xml</loc>

      <lastmod>2004-10-01T18:23:17+00:00</lastmod>

   </sitemap>

</sitemapindex>

<!-- Sitemap for individual URLs -->

<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"

         xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">


   <url>

      <loc>http://www.example.com/page-1/</loc>

      <lastmod>2005-01-01</lastmod>

      <changefreq>monthly</changefreq>

      <priority>0.8</priority>

   </url>

   <url>

      <loc>http://www.example.com/page-2/</loc>

      <lastmod>2005-01-01</lastmod>

      <changefreq>monthly</changefreq>

      <priority>0.8</priority>

   </url>

   <url>

      <loc>http://www.example.com/page-3/</loc>

      <lastmod>2005-01-01</lastmod>

      <changefreq>monthly</changefreq>

      <priority>0.8</priority>

   </url>


</urlset>

Technically this is possible, and I will make sure to maintain directory hierarchy. Although, I am not sure if this is allowed as per the protocol.

If I create a sitemap like this, then is it acceptable by Google, and Bing?

  • Why are you proposing this as opposed to having just one sitemap without an index at all? – Stephen Ostermiller Aug 8 at 9:00
  • There are about 630k pages. Initially I thought to go-ahead with traditional approach where to create one sitemap index file with links to 13 sub-sitemap, each with 50k URLs. But then thought how about trying it in a different way? Technically it is easy to configure but there aren’t any documentation on such structure. That’s why thought to ask before implementing. – Bhargav Joshi Aug 8 at 12:38
1

You cannot combine your sitemap index and sitemap into one file. There is a limit of 50,000 URLs per file. Putting all your URLs into one sitemap would exceed the limits and cause search engines not to be able to download and process your sitemap file. You need to keep all 13 sub-sitemaps because of these limits. See https://www.sitemaps.org/protocol.html#index

If you had few enough URLs to use a single file, you could just put all your URLs into one file and not use a sitemap index file at all.

Otherwise, it is not correct to combine a sitemap index file with a list of URLs. They should be separate files.

| improve this answer | |
  • i see.. yeah, understood that need to create 13 sub-sitemaps. That's why I was thinking to combine sitemap-index and sitemap file it self. As per my estimation, if I combine like this, then there might be over 2500 such sitemap-index combined with sitemap file; with maximum URL count for one file is about 10,000. I know it sounds weird, and I never tried such things before; that's why thought to ask. – Bhargav Joshi Aug 10 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.