@astrojs/sitemap
3.7.6 · 18 Nov 2026MIT6.2M / weekRepositoryHomepagenpmAtom feed
58 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 3.x · latest line
3.7.6
18 Nov 2026Fixes i18n locale matching for pages whose first path segment is named like an
Object.prototypeproperty, such as/constructor/or/toString/. These were treated as locales, producing invalid alternate links. Also rejects an i18ndefaultLocalethat is only an inherited object property rather than a configured locale.
3.7.5
13 Nov 2026Speeds up sitemap chunk generation for large sites by tracking assigned URLs with a Set.
3.7.4
31 Aug 2026Fixes the sitemap outputting a URL with an empty path for the homepage (e.g.
https://example.cominstead ofhttps://example.com/) whentrailingSlashis set to"never"orbuild.formatis set to"file"
3.7.3
26 May 2026Improves
<lastmod>accuracy in the sitemap index. Each<sitemap>entry insitemap-index.xmlis now stamped with the most recentlastmodof the URLs in the child sitemap it points to, instead of repeating a single global date on every entry. When a child sitemap has no per-URLlastmod, the entry falls back to thelastmodoption as before. This gives search engines a per-file freshness signal, so they can tell which child sitemaps actually changed without refetching all of them.
3.7.2
26 Mar 2026Fixes i18n fallback pages missing from the generated sitemap when using
fallbackType: 'rewrite'.
3.7.1
10 Mar 2026Update to Astro 6 beta
Updates usage of zod to own dependency rather than relying on
astro/zodUpdates how routes are retrieved to avoid relying on a deprecated API
Patch Changes
Update to Astro 6 beta
Updates usage of zod to own dependency rather than relying on
astro/zodUpdates how routes are retrieved to avoid relying on a deprecated API
3.7.0
16 Jan 2026Adds the ability to split sitemap generation into chunks based on customizable logic. This allows for better management of large sitemaps and improved performance. The new
chunksoption in the sitemap configuration allows users to define functions that categorize sitemap items into different chunks. Each chunk is then written to a separate sitemap file.integrations: [ sitemap({ serialize(item) { th return item }, chunks: { // this property will be treated last on the configuration 'blog': (item) => { // will produce a sitemap file with `blog` name (sitemap-blog-0.xml) if (/blog/.test(item.url)) { // filter path that will be included in this specific sitemap file item.changefreq = 'weekly'; item.lastmod = new Date(); item.priority = 0.9; // define specific properties for this filtered path return item; } }, 'glossary': (item) => { if (/glossary/.test(item.url)) { item.changefreq = 'weekly'; item.lastmod = new Date(); item.priority = 0.7; return item; } } // the rest of the path will be stored in `sitemap-pages.0.xml` }, }), ],
3.6.1
7 Jan 2026Updates how routes are retrieved to avoid relying on a deprecated API
3.6.0
17 Sep 2025Adds a new configuration option
namespacesfor more control over XML namespaces used in sitemap generationExcluding unused namespaces can help create cleaner, more focused sitemaps that are faster for search engines to parse and use less bandwidth. If your site doesn't have news content, videos, or multiple languages, you can exclude those namespaces to reduce XML bloat.
The
namespacesoption allows you to configurenews,xhtml,image, andvideonamespaces independently. All namespaces are enabled by default for backward compatibility and no change to existing projects is necessary. But now, you can choose to streamline your XML and avoid unnecessary code.For example, to exclude the video namespace from your sitemap, set
video: falsein your configuration:// astro.config.mjs import { sitemap } from '@astrojs/sitemap'; export default { integrations: [ sitemap({ namespaces: { video: false, // other namespaces remain enabled by default } }) ] };The generated XML will not include the
xmlns:videonamespace:<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" > <!-- ... --> </urlset>
3.5.1
22 Aug 2025Fixes the issue with the option
lastmodwhere if it is defined it applies correctly to<url>entries in eachsitemap-${i}.xmlfile but not the<sitemap>entries in the rootsitemap-index.xmlfile.
3.5.0
14 Aug 2025Adds a
customSitemapsoption to include extra sitemaps in thesitemap-index.xmlfile generated by Astro.This is useful for multi-framework setups on the same domain as your Astro site (
example.com), such as a blog atexample.com/blogwhose sitemap is generated by another framework.The following example shows configuring your Astro site to include sitemaps for an externally-generated blog and help center along with the generated sitemap entries in
sitemap-index.xml:Example:
import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://example.com', integrations: [ sitemap({ customSitemaps: [ 'https://example.com/blog/sitemap.xml', 'https://example.com/helpcenter/sitemap.xml', ], }), ], });Learn more in the
@astrojs/sitemapconfiguration documentation.
3.4.2
28 Jul 2025Upgrades zod
3.4.1
4 Jun 2025Uncaught errors in the
filtermethod will now bubble, causing the astro build to fail.
3.4.0
12 May 2025Customize the filenames of sitemap XML files generated by the
@astro/sitemapintegration by settingfilenameBasein the integration configuration settings. This may be useful when deploying an Astro site at a path on a domain with preexisting sitemap files.Generated sitemap files will appear at
/sitemap-0.xmland/sitemap-index.xmlby default, which may conflict with preexisting files. SetfilenameBaseto a custom value to avoid that if so:import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://example.com', integrations: [ sitemap({ filenameBase: 'astronomy-sitemap', }), ], });This will yield sitemap and index files as
https://example.com/astronomy-sitemap-0.xmlandhttps://example.com/astronomy-sitemap-index.xml.
3.3.1
23 Apr 2025Removes unused code
3.3.0
18 Mar 2025Add support for XSL in sitemap-index.xml
3.2.1
15 Oct 2024Adds missing
xslURLproperty toSitemapOptionstype.
3.2.0
3 Oct 2024Adds new
xslURLoption to enable styling of sitemaps
3.1.6
17 Jun 2024Refactor to use Astro's integration logger for logging
3.1.5
22 May 2024cefeadfThanks @adrianlyjak! - Fixes false positives for status code routes like404and500when generating sitemaps.
3.1.4
18 Apr 2024Fixes an issue where the root url does not follow the
trailingSlashconfig option
3.1.3
16 Apr 2024Improves performance when generating the sitemap data
3.1.2
26 Mar 2024Fixes an issue where the base path is missing in
sitemap-index.xml.
3.1.1
21 Feb 2024Revert #9846
The feature to customize the file name of the sitemap was reverted due to some internal issues with one of the dependencies. With an non-deterministic behaviour, the sitemap file was sometime emitted with incorrect syntax.
Fixes URL generation for routes that rest parameters and start with
/
3.1.0
20 Feb 2024Adds a new configuration option
prefixthat allows you to change the defaultsitemap-*.xmlfile name.By default, running
astro buildcreates bothsitemap-index.xmlandsitemap-0.xmlin your output directory.To change the names of these files (e.g. to
astrosite-index.xmlandastrosite-0.xml), set theprefixoption in yoursitemapintegration configuration:import { defineConfig } from 'astro/config'; import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://example.com', integrations: [ sitemap({ prefix: 'astrosite-', }), ], });This option is useful when Google Search Console is unable to fetch your default sitemap files, but can read renamed files.
3.0.5
18 Jan 2024Fixes generated URLs when using a
basewith a SSR adapter
3.0.4
27 Dec 2023Updates README
3.0.3
1 Nov 2023Only updates a dependency:Zod 3.22.4
3.0.2
18 Oct 2023Display output directory in the sitemap build result
3.0.1
5 Oct 2023Add provenance statement when publishing the library from CI
3.0.0
30 Aug 2023- Breaking
Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
- Breaking
Astro 3.0 Release Candidate
- 2.x
2.0.2
15 Aug 2023Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.
2.0.1
20 Jul 2023Ensure nested 404 and 500 pages are always excluded
2.0.0
18 Jul 2023- Breaking
Sitemap only includes
pageroutes (generated by.astrofiles) rather than all routes (pages, endpoints, or redirects). This behavior matches our existing documentation, but is a breaking change nonetheless. Ensure trailing slash is only added to page routes
- 1.x
1.4.0
14 Jul 2023Ensure sitemap only excludes numerical pages matching
/404and/500exactly
1.3.3
2 Jun 2023Fix sitemap does not filter pages
1.3.2
30 May 2023Exported enum type to support typescript > 5.0
1.3.1
9 May 2023Fix generation for static dynamic routes
1.3.0
4 May 2023Adds support to SSR routes to sitemap generation.
1.2.2
5 Apr 2023Fix sitemap generation with a base path
1.2.1
13 Mar 2023Consistency improvements to several package descriptions
1.2.0
7 Mar 2023Updated compilation settings to disable downlevelling for Node 14
1.1.0
23 Feb 2023Update
ChangeFreqto support typescript configurations with string literal or predefined value.
1.0.1
30 Jan 2023Update READMEs for consistency
1.0.0
9 Aug 2022- Breaking
Astro v1.0 is out! Read the official announcement post.
No breaking changes. This package is now officially stable and compatible with
astro@1.0.0!
- 0.3.x
0.3.0
26 Jul 2022New
outputconfiguration optionThis change introduces a new "output target" configuration option (
output). Setting the output target lets you decide the format of your final build, either:If
outputis omitted from your config, the default value"static"will be used.When using the
"server"output target, you must also include a runtime adapter via theadapterconfiguration. An adapter will adapt your final build to run on the deployed platform of your choice (Netlify, Vercel, Node.js, Deno, etc).To migrate: No action is required for most users. If you currently define an
adapter, you will need to also addoutput: 'server'to your config file to make it explicit that you are building a server. Here is an example of what that change would look like for someone deploying to Netlify:import { defineConfig } from 'astro/config'; import netlify from '@astrojs/netlify/functions'; export default defineConfig({ adapter: netlify(), + output: 'server', });Update README to reflect
@astrojs/sitemap@0.2.0changesRemoved "experimental" from astro add instructions
- 0.2.x
0.2.6
12 Jul 2022Integration README fixes
0.2.5
9 Jul 2022Small README fixes
Support adapters and third party packages
0.2.4
30 Jun 2022Update READMEs
0.2.3
28 Jun 2022If
serializefunction returnsundefinedfor the passed entry, such entry will be excluded from sitemap
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.