Packages

@astrojs/sitemap

3.7.6 · 18 Nov 2026MIT6.2M / weekRepositoryHomepagenpmAtom feed

Your version

58 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 3.x · latest line
  2. 3.7.6

    18 Nov 2026
    • Fixes i18n locale matching for pages whose first path segment is named like an Object.prototype property, such as /constructor/ or /toString/. These were treated as locales, producing invalid alternate links. Also rejects an i18n defaultLocale that is only an inherited object property rather than a configured locale.

  3. 3.7.5

    13 Nov 2026
    • Speeds up sitemap chunk generation for large sites by tracking assigned URLs with a Set.

  4. 3.7.4

    31 Aug 2026
    • Fixes the sitemap outputting a URL with an empty path for the homepage (e.g. https://example.com instead of https://example.com/) when trailingSlash is set to "never" or build.format is set to "file"

  5. 3.7.3

    26 May 2026
    • Improves <lastmod> accuracy in the sitemap index. Each <sitemap> entry in sitemap-index.xml is now stamped with the most recent lastmod of 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-URL lastmod, the entry falls back to the lastmod option 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.

  6. 3.7.2

    26 Mar 2026
    • Fixes i18n fallback pages missing from the generated sitemap when using fallbackType: 'rewrite'.

  7. 3.7.1

    10 Mar 2026
    • Update to Astro 6 beta

    • Updates usage of zod to own dependency rather than relying on astro/zod

    • Updates how routes are retrieved to avoid relying on a deprecated API

  8. 3.7.0

    16 Jan 2026
    • Adds 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 chunks option 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`
          },
        }),
      ],
      
      
  9. 3.6.1

    7 Jan 2026
    • Updates how routes are retrieved to avoid relying on a deprecated API

  10. 3.6.0

    17 Sep 2025
    • Adds a new configuration option namespaces for more control over XML namespaces used in sitemap generation

      Excluding 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 namespaces option allows you to configure news, xhtml, image, and video namespaces 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: false in 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:video namespace:

      <?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>
  11. 3.5.1

    22 Aug 2025
    • Fixes the issue with the option lastmod where if it is defined it applies correctly to <url> entries in each sitemap-${i}.xml file but not the <sitemap> entries in the root sitemap-index.xml file.

  12. 3.5.0

    14 Aug 2025
    • Adds a customSitemaps option to include extra sitemaps in the sitemap-index.xml file generated by Astro.

      This is useful for multi-framework setups on the same domain as your Astro site (example.com), such as a blog at example.com/blog whose 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/sitemap configuration documentation.

  13. 3.4.2

    28 Jul 2025
    • Upgrades zod

  14. 3.4.1

    4 Jun 2025
    • Uncaught errors in the filter method will now bubble, causing the astro build to fail.

  15. 3.4.0

    12 May 2025
    • Customize the filenames of sitemap XML files generated by the @astro/sitemap integration by setting filenameBase in 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.xml and /sitemap-index.xml by default, which may conflict with preexisting files. Set filenameBase to 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.xml and https://example.com/astronomy-sitemap-index.xml.

  16. 3.3.1

    23 Apr 2025
    • Removes unused code

  17. 3.3.0

    18 Mar 2025
    • Add support for XSL in sitemap-index.xml

  18. 3.2.1

    15 Oct 2024
    • Adds missing xslURL property to SitemapOptions type.

  19. 3.2.0

    3 Oct 2024
    • Adds new xslURL option to enable styling of sitemaps

  20. 3.1.6

    17 Jun 2024
    • Refactor to use Astro's integration logger for logging

  21. 3.1.5

    22 May 2024
    • cefeadf Thanks @adrianlyjak! - Fixes false positives for status code routes like 404 and 500 when generating sitemaps.

  22. 3.1.4

    18 Apr 2024
    • Fixes an issue where the root url does not follow the trailingSlash config option

  23. 3.1.3

    16 Apr 2024
    • Improves performance when generating the sitemap data

  24. 3.1.2

    26 Mar 2024
    • Fixes an issue where the base path is missing in sitemap-index.xml.

  25. 3.1.1

    21 Feb 2024
    • Revert #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 /

  26. 3.1.0

    20 Feb 2024
    • Adds a new configuration option prefix that allows you to change the default sitemap-*.xml file name.

      By default, running astro build creates both sitemap-index.xml and sitemap-0.xml in your output directory.

      To change the names of these files (e.g. to astrosite-index.xml and astrosite-0.xml), set the prefix option in your sitemap integration 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.

  27. 3.0.5

    18 Jan 2024
    • Fixes generated URLs when using a base with a SSR adapter

  28. 3.0.4

    27 Dec 2023
    • Updates README

  29. 3.0.3

    1 Nov 2023

    Only updates a dependency:Zod 3.22.4

  30. 3.0.2

    18 Oct 2023
    • Display output directory in the sitemap build result

  31. 3.0.1

    5 Oct 2023
    • Add provenance statement when publishing the library from CI

  32. 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

  33. 2.x
  34. 2.0.2

    15 Aug 2023

    Maintenance only: docs, tests, build or refactoring. Nothing changes in how you use it.

  35. 2.0.1

    20 Jul 2023
    • Ensure nested 404 and 500 pages are always excluded

  36. 2.0.0

    18 Jul 2023
    • Breaking

      Sitemap only includes page routes (generated by .astro files) 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

  37. 1.x
  38. 1.4.0

    14 Jul 2023
    • Ensure sitemap only excludes numerical pages matching /404 and /500 exactly

  39. 1.3.3

    2 Jun 2023
    • Fix sitemap does not filter pages

  40. 1.3.2

    30 May 2023
    • Exported enum type to support typescript > 5.0

  41. 1.3.1

    9 May 2023
    • Fix generation for static dynamic routes

  42. 1.3.0

    4 May 2023
    • Adds support to SSR routes to sitemap generation.

  43. 1.2.2

    5 Apr 2023
    • Fix sitemap generation with a base path

  44. 1.2.1

    13 Mar 2023
    • Consistency improvements to several package descriptions

  45. 1.2.0

    7 Mar 2023
    • Updated compilation settings to disable downlevelling for Node 14

  46. 1.1.0

    23 Feb 2023
    • Update ChangeFreq to support typescript configurations with string literal or predefined value.

  47. 1.0.1

    30 Jan 2023
    • Update READMEs for consistency

  48. 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!

  49. 0.3.x
  50. 0.3.0

    26 Jul 2022
    • New output configuration option

      This change introduces a new "output target" configuration option (output). Setting the output target lets you decide the format of your final build, either:

      If output is 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 the adapter configuration. 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 add output: '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.0 changes

    • Removed "experimental" from astro add instructions

  51. 0.2.x
  52. 0.2.6

    12 Jul 2022
    • Integration README fixes

  53. 0.2.5

    9 Jul 2022
    • Small README fixes

    • Support adapters and third party packages

  54. 0.2.4

    30 Jun 2022
    • Update READMEs

  55. 0.2.3

    28 Jun 2022
    • If serialize function returns undefined for 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.