---
title: "Disabling Indexing · Nuxt Sitemap · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/sitemap/guides/filtering-urls"
last_updated: "2026-08-14T21:01:06.673Z"
meta:
  description: "How to filter the URLs generated from application sources."
  "og:description": "How to filter the URLs generated from application sources."
  "og:title": "Disabling Indexing · Nuxt Sitemap · Nuxt SEO"
---

Nuxt SEO on GitHub

Switch to SitemapSwitch to Nuxt SEOSwitch to RobotsSwitch to OG ImageSwitch to Schema.orgSwitch to Link CheckerSwitch to SEO UtilsSwitch to Site ConfigSwitch to Skew ProtectionSwitch to AI Ready

**Core Concepts**

# **Disabling Indexing**

## Introduction

When viewing your sitemap.xml for the first time, you may notice some URLs you don't want to be included. These URLs are most likely coming from [**~~Application Sources~~**](https://nuxtseo.com/docs/sitemap/getting-started/data-sources).

If you don't want to disable these sources but want to remove these URLs you have a couple of options.

## Nuxt Robots

The easiest way to block search engines from indexing a URL is to use the [**~~Nuxt Robots~~**](https://nuxtseo.com/docs/robots/getting-started/installation) module and simply block the URL in your robots.txt.

[Robots  **  ** Tame the robots crawling and indexing your site with ease.](https://nuxtseo.com/docs/robots/getting-started/introduction)

Nuxt Sitemap will honor any blocked pages from being ignored in the sitemap.

## Disabling indexing with Route Rules

If you don't want a page in your sitemap because you don't want search engines to crawl it, then you can make use of the `**robots**` route rule. For comprehensive route rules documentation, see [**~~Nuxt Robots route rules~~**](https://nuxtseo.com/docs/robots/guides/route-rules).

### Disabling indexing for a pattern of URLs

If you have a pattern of URLs that you want hidden from search you can use route rules.

nuxt.config.ts

```ts
export default defineNuxtConfig({
  routeRules: {
    // Don't add any /secret/** URLs to the sitemap.xml
    '/secret/**': { robots: false },
  }
})
```

### Inline route rules

If you just have some specific pages, you can use the experimental [`**defineRouteRules()**`](https://nuxt.com/docs/api/utils/define-route-rules), which must be enabled.

```vue
<script setup lang="ts">
defineRouteRules({
  robots: false
})
</script>
```

## Filter URLs with include / exclude

For all other cases, you can use the `**include**` and `**exclude**` module options to filter URLs.

nuxt.config.ts

```ts
export default defineNuxtConfig({
  sitemap: {
    // exclude all URLs that start with /secret
    exclude: ['/secret/**'],
    // include all URLs that start with /public
    include: ['/public/**'],
  }
})
```

Either option supports either an array of strings, RegExp objects or a `**{ regex: string }**` object.

Providing strings will use the [**~~route rules path matching~~**](https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering) which does not support variable path segments in front of static ones.

For example, `**/foo/****` will work but `**/foo/**/bar**` will not. To get around this you should use regex.

**Regex filtering** is more powerful and can be used to match more complex patterns. It's recommended to pass a `**RegExp**` object explicitly.

nuxt.config.ts

```ts
export default defineNuxtConfig({
  sitemap: {
    exclude: [
      // exclude /foo/**/bar using regex
      new RegExp('/foo/.*/bar')
    ],
  }
})
```

**Was this page helpful?**

### **Related **

[**Data Sources**](https://nuxtseo.com/docs/sitemap/getting-started/data-sources)

[**Nuxt Robots**](https://nuxtseo.com/docs/robots/getting-started/installation)

[**Controlling Web Crawlers**](https://nuxtseo.com/learn-seo/nuxt/controlling-crawlers)

[**Dynamic URL Endpoints** Use runtime API endpoints to generate dynamic URLs for your sitemap.](https://nuxtseo.com/docs/sitemap/guides/dynamic-urls) [**Multi Sitemaps** Generate multiple sitemaps for different sections of your site.](https://nuxtseo.com/docs/sitemap/guides/multi-sitemaps)