---
title: "Nuxt Sitemap v4.0.0"
description: "Release notes for v4.0.0 of Nuxt Sitemap."
canonical_url: "https://nuxtseo.com/docs/sitemap/releases/v4"
last_updated: "2026-05-09T19:38:44.087Z"
---

## Background

Over the last couple of months I've had many issues reported with similar themes:

- Dynamic URLs are hard to work with
- It's difficult to get multiple sitemaps to show the correct URLs
- I18n has many small issues

I hope this release can resolve these. It has required replacing much of the underlying logic, please test your sitemaps after upgrading.

## Features 🚀

### 🥫 Sitemap Sources

The v4 introduces the official concept of 'sources' to your sitemaps.

Every URL within your sitemap will belong to a source. A source will either be a User source or a Application source.

This concept existed before v4 in different forms, v4 aims to clean them up and make working with them much easier.

For full documentation see [Sitemap Sources](/docs/sitemap/getting-started/data-sources).

### 🤝 Nuxt Dev Tools Integration

Nuxt Sitemap now has a dedicated tab in Nuxt Dev Tools to help you debug.

<details open="true" className="details-reset,border,rounded-2">
<summary className="px-3,py-2">
<svg ariaHidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" dataViewComponent="true" className="octicon,octicon-device-camera-video">
<path d="M16 3.75v8.5a.75.75 0 0 1-1.136.643L11 10.575v.675A1.75 1.75 0 0 1 9.25 13h-7.5A1.75 1.75 0 0 1 0 11.25v-6.5C0 3.784.784 3 1.75 3h7.5c.966 0 1.75.784 1.75 1.75v.675l3.864-2.318A.75.75 0 0 1 16 3.75Zm-6.5 1a.25.25 0 0 0-.25-.25h-7.5a.25.25 0 0 0-.25.25v6.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-6.5ZM11 8.825l3.5 2.1v-5.85l-3.5 2.1Z">



</path>
</svg>


    <span ariaLabel="Video description nuxt-simple-sitemap-devtools.webm" className="m-1">

nuxt-simple-sitemap-devtools.webm

</span>


    <span className="dropdown-caret">



</span>
</summary>


  <video src="https://user-images.githubusercontent.com/5326365/282252319-269d8421-0704-4336-81a6-dd597fe80d38.webm" dataCanonicalSrc="https://user-images.githubusercontent.com/5326365/282252319-269d8421-0704-4336-81a6-dd597fe80d38.webm" controls="true" muted="true" className="d-block,rounded-bottom-2,border-top,width-fit" style="max-height:640px; min-height: 200px">



</video>
</details>

### 💬 More i18n Improvements

- Locale domain support ([#155](https://github.com/nuxt-modules/sitemap/issues/155))
- Support pages opt-outed using `defineI18nRoute(false)` ([#126](https://github.com/nuxt-modules/sitemap/issues/126))
- Only add trusted i18n routes, will use meta tags when prerendering
- Less aggressive filtering
- Opt-in to transform dynamic URLs `__i18nTransform: true`

See the updated [i18n documentation](/docs/sitemap/guides/i18n)

### 🚀 Caching Improvements

Now utilises native route rules. By default will set up SWR rules for 10 minutes.

Learn more on the [Sitemap Caching](/docs/sitemap/advanced/performance) guide.

## Other Improvements

### Nitro Composables for better types

When creating an API endpoint that returns URLs you should use the new [`defineSitemapEventHandler()`](/docs/sitemap/nitro-api/nitro-hooks) function for full TypeScript support.

```ts
// api/sitemap.ts
export default defineSitemapEventHandler(() => {
  return ['/foo']
})
```

### Prerendering Improvements

Previously prerendering was done in a Node context, this will now run in a Nitro context which will provide better consistency between prerender and runtime environments.

### Video Support

Video entries are now supported properly. ([#159](https://github.com/nuxt-modules/sitemap/issues/159))

## ⚠️ Deprecations

- `cacheTtl` is deprecated, you should use `cacheMaxAgeSeconds` which is more explicit.
- `inferStaticPagesAsRoutes` is deprecated, if you were using this to opt-out of pages, you should use `excludeAppSources: true`

## ☠️ Breaking Changes

### Nuxt Hooks no longer supported

If you were using Nuxt hooks to modify the prerendered sitemap, you will need to migrate these to Nitro hooks.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  hooks: {
    // old - no longer supported
    'sitemap:resolved': function (ctx) {},
    'sitemap:output': function (ctx) {}
  },
})
```

```ts [server/plugins/sitemap]
export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('sitemap:output', async (ctx) => {
    // supported!
  })
})
```

### Multi Sitemap App Sources

By default, app sources will no longer be included in multi sitemap implementations. You will need to use `includeAppSources: true` to re-enable it. See [Extending App Sources](/docs/sitemap/guides/multi-sitemaps#extending-app-sources) for more information.

### Removed deprecations

- The hook `sitemap:prerender` has been removed. You should use `sitemap:resolved` instead.
- The config `trailingSlash` and `siteUrl` has been removed. You should use site config, see [Setting Site Config](/docs/site-config/guides/how-it-works).
- The config `autoAlternativeLangPrefixes` has been removed. If you'd like to set up automatic alternative language prefixes use `__i18nTransform`.

## Support my work

This release took over 40 hours.
If technical SEO developer experience in Nuxt is important to you, consider [supporting my work](https://github.com/sponsors/harlan-zw) on Nuxt SEO.
