2

As the title can i use <sitemap> tag in <urlset> to point to my second sitemap?

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <url>
    <loc>http://website.com/page1</loc>
    <changefreq>hourly</changefreq>
  </url>

  <url>
    <loc>http://website.com/page2</loc>
    <changefreq>hourly</changefreq>
  </url>

  <sitemap>
    <loc>http://website.com/sitemap.xml?offset=1000</loc>
    <changefreq>always</changefreq>
  </sitemap>

</urlset>

or must i use <url> to point to my second sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <url>
    <loc>http://website.com/page1</loc>
    <changefreq>hourly</changefreq>
  </url>

  <url>
    <loc>http://website.com/page2</loc>
    <changefreq>hourly</changefreq>
  </url>

  <url>
    <loc>http://website.com/sitemap.xml?offset=1000</loc>
    <changefreq>always</changefreq>
  </url>

</urlset>

I cannot use <sitemapindex> as i have too many pages to generate a total index file.

John Conde
  • 217,595
  • 99
  • 455
  • 496
Jeremy John
  • 1,665
  • 3
  • 18
  • 31
  • About why you can’t use a Sitemap index file: I’m not sure I understand your reason. If it’s possible for you to add the sitemap URLs under `urlset` of one file, it should also be possible to add these URLs in a different file under `sitemapindex`, no? Each Sitemap index file can have 50000 sitemap URLs, and you can even provide multiple index files ([see limits](http://stackoverflow.com/a/35227004/1591669)). – unor May 15 '17 at 01:51

1 Answers1

2

As the Sitemap protocol describes, you should use a Sitemap index file.

If you add a sitemap element as child of the urlset element (your first example), it will likely be ignored, as sitemap is not one of the expected elements.

If you add the sitemap as url element inside urlset (your second example), your sitemap file is just another URL entry in your sitemap. You shouldn’t expect that consumers handle this entry as another sitemap, as this is not a defined behaviour, but specific consumers might do this anyway, of course.

If you can’t provide a Sitemap index file, you could (as a better-than-nothing alternative) provide multiple Sitemap records in your robots.txt:

User-agent: *
Disallow:

Sitemap: https://example.com/sitemap.xml?offset=2000

Sitemap: https://example.com/sitemap.xml?offset=1000

Sitemap: https://example.com/sitemap.xml
unor
  • 92,415
  • 26
  • 211
  • 360