Home > database >  NextJs - How to remove duplicate URL from sitemap generator?
NextJs - How to remove duplicate URL from sitemap generator?

Time:09-15

In NextJs app, I am using nextjs-sitemap-generator package to handle sitemap. Here I am trying to avoid some duplicate URLs, how can I add it in ignoredPaths.

Eg: I have http://localhost/about/security and http://localhost/security, I want to remove only http://localhost/security, so If I add ignoredPaths: ['/security'] then both links will get remove.

Please help to solve this.

If I use next-sitemap package how can I do the same changes using exclude or other option?

CodePudding user response:

Try with this regex!

ignoredPaths: ["/admin", /^\/security/ ],
  • Related