next-sitemap
next-sitemap copied to clipboard
Adding a sitemap to the robotsTxtOptions.additionalSitemaps list adds it to the sitemap index
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
- Create a serverside sitemap index using getServerSideSitemapIndex.
- Attempt to exclude it using the exclude list.
- Examine the generated sitemap.xml index.
- 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?
I'm having the same problem, and I'm dealing with it by disabling the robotsOption.
Any workarounds? :thinking: 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.
Can this issue be reopened? As far as I can see next-sitemap
cannot create valid dynamic sitemaps at all so seems like pretty major issue to me. And even the fix is easy and it's already done: https://github.com/iamvishnusankar/next-sitemap/pull/568