iamvishnusankar/next-sitemap

Adding a sitemap to the robotsTxtOptions.additionalSitemaps list adds it to the sitemap index

andrewliden opened this issue · 5 comments

Describe the bug
Adding a sitemap to the robotsTxtOptions.additionalSitemaps list adds it to the sitemap index. The exclude list does not solve this problem. I even tried excluding all by adding '*' to the exclude list. The sitemap in robotsTxtOptions.additionalSitemaps was still added to the index (and it was the only entry).
This is problematic, because it creates a nested sitemap index error. Nested sitemap indexes are generally unsupported by search engines.

To Reproduce

  1. Create a serverside sitemap index using getServerSideSitemapIndex.
  2. Attempt to exclude it using the exclude list.
  3. Examine the generated sitemap.xml index.
  4. Notice that the sitemap.xml index contains an index, which is a nested sitemap index, and thus a standards violation.

Expected behavior
Sitemap indexes should be included in robots.txt, but not in the sitemap.xml sitemap index. Excluding a sitemap index should remove it.

I have the same issue too, did you find a workaround?

ok4d4 commented

I'm having the same problem, and I'm dealing with it by disabling the robotsOption.

Any workarounds? 🤔 It's not very viable to use this library without dynamic sitemaps and AFAIK there's no valid way to use dynamic sitemaps with this lib because of this bug.

Closing this issue due to inactivity.