Published on

Exclude pages from netlifys sitemap plugin

Authors

I included the netlify sitemap plugin in my nuxt.js site. However I kept getting excluded pages still showing up! Hopefully this saves you some time if it’s happening to you as well.

You need to remember nuxt is generating static HTML files, so even though the route is /contact/success the page to exclude (since it’s looking at files) is /contact/success.html

Here’s an example of a working nuxt.js netlify.toml with working excludes.

Note the netlifycms admin route is NOT an html file, do not add it to there.

[build]
  publish = "dist"
  command = "yarn generate"
  functions = "app/functions"

[[plugins]]
  package = "@netlify/plugin-sitemap"

  [plugins.inputs]
    exclude = [
      '**/admin',
      '**/200.html',
      '**/about.html',
      '**/contact/success.html',
    ]