Skip to content

[gatsby-plugin-sitemap] Multiple/Split Sitemap Files #12100

@youmustfight

Description

@youmustfight

Summary

When submitting sitemaps to Google Search Console, an error is thrown for sitemaps with more than 50,000 urls. It'd be great if there was an option to have multiple sitemap files generate with a 50,000 url limit per file.

This could be done with a number limit or maybe an include option (rather than just exclude)?

Basic example

Expecting sitemap-1.xml, sitemap-2.xml, etc.

  {
    resolve: `gatsby-plugin-sitemap`,
    options: {
       split: 50000,
     }
  }

or manually defined

  {
    resolve: `gatsby-plugin-sitemap`,
    options: {
       output: `/sitemap.xml`,
       exclude: ['/learn/*'],
     }
  },
  {
    resolve: `gatsby-plugin-sitemap`,
    options: {
       output: `/sitemap-learn.xml`,
       include: ['/learn/*'],
     }
  },

Motivation

For a larger website, this is a critical way to make sure all pages are crawled and indexed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssue with a clear description that the community can help with.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions