Next.js Discord

Discord Forum

How to configure `robots.ts` for multiple sitemaps?

Unanswered
Entlebucher Mountain Dog posted this in #help-forum
Open in Discord
Entlebucher Mountain DogOP
Info: I am currently following the docs (https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generating-multiple-sitemaps)

Status: I have trouble figuring out what the value should be for sitemap.

export default function robots(): MetadataRoute.Robots {
  return {
    rules: {
      userAgent: "*",
      allow: ["/", "/r/"],
      disallow: ["/account", "/billing", "/my-reports", "/settings", "/auth/"],
    },
    sitemap: [root + "/sitemap.xml", root + "/r/sitemap/[id].xml"],
  };
}


Is this correct?

0 Replies