Sitemap
Guides

Customising the UI

Change the look and feel of your sitemap.

Disabling the XLS

What you're looking at when you view the sitemap.xml is a XLS file, think of it just like you would a CSS file for HTML.

To view the real sitemap.xml, you can view the source of the page. If you prefer, you can disable the XLS by setting xsl to false.

export default defineNuxtConfig({
  sitemap: {
    xsl: false
  }
})

Changing the columns

You can change the columns that are displayed in the sitemap by modifying the xslColumns option.

These have no effect on SEO and is purely for developer experience.

Note: You must always have a URL column at the start.

export default defineNuxtConfig({
  sitemap: {
    xslColumns: [
      // URL column must always be set, no value needed
      { label: 'URL', width: '75%' },
      { label: 'Last Modified', select: 'sitemap:lastmod', width: '25%' },
    ],
  },
})

The select you provide is an XLS expression that will be evaluated against the sitemap entry. It's recommended to prefix the value with sitemap: if in doubt.

Example: Adding priority and changefreq

export default defineNuxtConfig({
  sitemap: {
    xslColumns: [
      { label: 'URL', width: '50%' },
      { label: 'Last Modified', select: 'sitemap:lastmod', width: '25%' },
      { label: 'Priority', select: 'sitemap:priority', width: '12.5%' },
      { label: 'Change Frequency', select: 'sitemap:changefreq', width: '12.5%' },
    ],
  },
})

Example: Adding hreflang

Requires >= 3.3.2

export default defineNuxtConfig({
  sitemap: {
    xslColumns: [
      { label: 'URL', width: '50%' },
      { label: 'Last Modified', select: 'sitemap:lastmod', width: '25%' },
      { label: 'Hreflangs', select: 'count(xhtml:link)', width: '25%' },
    ],
  },
})

Disabling tips

In development tips are displayed on the sitemap page to help you get started.

You can disable these tips by setting the xslTips option to false.

export default defineNuxtConfig({
  sitemap: {
    xslTips: false,
  },
})