Exclude pages in sitemap

Hi friends,

I’ve been trying like crazy to get the Netlify sitemap plugin to exclude certain pages but without luck.

I have some serverside rendered pages I would like to exclude:

And a SSG page:
(Can only embed a single media file, but it’s https://www.domain.com/contact/success)

My netlify.toml file looks like this:

package = "@netlify/plugin-sitemap"

  buildDir = ".next"
  exclude = [


I’ve also tried variations like:


What am I doing wrong? :grimacing:

Hey @kasperenterspeed,

I’m not sure how well that plugin works with Next.js sites, especially since it’s mostly dynamically rendered. You should try to create a sitemap using Next.js itself for best results.


Hey @hrishikesh,

Thank you for the quick reply. Won’t bother with the plugin anymore then - will just use a Next.js solution instead :+1:

1 Like