next-sitemap icon indicating copy to clipboard operation
next-sitemap copied to clipboard

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

Open andrewliden opened this issue 2 years ago • 1 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.

andrewliden avatar Sep 02 '22 17:09 andrewliden

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

ardeois avatar Sep 16 '22 19:09 ardeois

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

ok4d4 avatar Oct 16 '22 19:10 ok4d4

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.

FINDarkside avatar Jan 23 '23 14:01 FINDarkside

Closing this issue due to inactivity.

github-actions[bot] avatar Mar 25 '23 04:03 github-actions[bot]

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

FINDarkside avatar Aug 11 '23 15:08 FINDarkside