Skip to content

sitemapXml Reference

The sitemapXml function generates a sitemap.xml file for your Next.js application.

The sitemapXml function accepts one optional parameter: an array of route configuration objects.

type: SitemapConfig[]

An array of route configuration objects. Each object can contain the following properties:

type: string

The route path for the page (e.g., /about, /blog/post-1).

type: string | Date

The date when the page was last modified.

type: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never'

How frequently the page is likely to change.

type: number

The priority of this URL relative to other URLs on your site. Value must be between 0.0 and 1.0.

type: { languages?: Languages<string> }

Language alternates for the page.