In one of the previous post, we discussed how to automatically generate a sitemap for a website (Specifically Static Site) using Netlify sitemap plugin.
But in this post, we would be looking at how to exclude some certain pages that we don’t want to show on the sitemap page, since Google will crawl and index whatever it finds in the sitemap.
[[plugins]]
package = "@netlify/plugin-sitemap" # The netlify sitemap plugin
[plugins.inputs]
exclude = [
'**/admin', # Excluding the admin folder for netlifyCMS
'**/contact.html', # Excluding contact page
'**/404.html', # Excluding 404 page
]
Note:
Every pages like /contact, /about or /404 need .html to be added but in the case of the admin folder, you don’t put .html since it is a folder used for Netlify CMS