netlify-plugin-sitemap icon indicating copy to clipboard operation
netlify-plugin-sitemap copied to clipboard

Plugin adds unwanted "server/page" paths to sitemap for next js app

Open codebarz opened this issue 3 years ago • 6 comments

Describe the bug

Generated sitemap.xml has server path in page location for nextjs application.

To Reproduce

Steps to reproduce the behaviour:

  1. Install plugin in netlify app via the plugin installer on netlify dashboard
  2. Visit https://site.com/sitemap.xml

Expected behaviour

Rather than https://site.com/server/pages/signup, it should generate <loc> as https://site.com/signup

codebarz avatar Feb 01 '22 14:02 codebarz

Happening for me as well. Our SEO team picked up on the sitemap.xml output and just recently sent the issue my way. Ugh I hope this is fixed soon!

ryanscherler avatar Feb 01 '22 19:02 ryanscherler

This is happening to me as well, and I can't exclude it for some reason.

rileymacisaac avatar Mar 09 '22 20:03 rileymacisaac

I am also getting pages like /server/pages/500 in my sitemap

leobenkel avatar Aug 03 '22 15:08 leobenkel

This worked for me on our next.js app:

netlify.toml

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

  [plugins.inputs]
  exclude = [
    './.next/server/**',
  ]

ryanscherler avatar Aug 03 '22 16:08 ryanscherler

I ended up using https://github.com/iamvishnusankar/next-sitemap instead of the netlify plugin and it works much better

leobenkel avatar Aug 03 '22 16:08 leobenkel

This has also started happening to out site.

kartikye avatar Jan 17 '23 13:01 kartikye