Index of every page on this site: llms.txt

Exclude URLs from inspection by adding them to the excludeLinks array. This prevents specific links from being checked on any page where they appear.

To skip all link checking on certain pages entirely, see Exclude Pages.

Default Exclusions

The following patterns are excluded by default:

  • /_* paths (Nuxt internal routes such as /_nuxt/*, /_payload.json)
  • /llms.txt and /llms-*.txt (typically generated at build time, e.g. /llms-full.txt)

If the Nuxt configuration defines app.baseUrl, nuxt-link-checker automatically adds it to the link exclusion list to avoid misleading build warnings from <NuxtLink> handling links to "/" i.e. the root of the Nuxt app.

Until nuxt-link-checker v5.0.7, <NuxtLink to="/">home</NuxtLink> and similar were triggering some warning during the app compilation/build. See Exclude links to the application root below.

Pattern Types

Nuxt Link Checker supports three pattern types and evaluates them in order: RegExp first, then exact string match, then wildcard.

Exact Matches

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/about',
      '/contact',
    ],
  },
})

Wildcards

Uses radix3 route matching. * matches a single path segment, ** matches any number of segments.

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/admin/**', // All admin routes
      '/api/*', // Direct children only (/api/users, not /api/users/1)
      '/blog/*/comments', // Nested wildcards
    ],
  },
})
Wildcard patterns use route matching, not glob matching. /_nuxt/file_*.pdf will not work because * only matches full path segments. Use a RegExp pattern instead for partial segment matching.

Regular Expressions

For advanced matching (partial segments, file extensions, numeric patterns), use RegExp:

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      /^\/blog\/\d+$/, // Blog posts with numeric IDs
      /\.(pdf|zip)$/, // File downloads
      /\/_nuxt\/.*\.pdf/, // Nuxt asset PDFs
    ],
  },
})
nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      'https://example.com/**',
      /^https:\/\/.*\.example\.com/,
    ],
  },
})

Common Use Cases

Exclude Vite Asset URLs

When importing assets with ?url, Vite generates hashed filenames that trigger false positives. Use a RegExp to match them:

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      /\/_nuxt\/.*\.pdf/, // All PDF assets
    ],
  },
})

Exclude Dynamic Routes

If you have dynamic routes that aren't prerendered:

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/user/**',
      '/products/**',
    ],
  },
})

Exclude Auth-Protected Routes

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/dashboard/**',
      '/profile/**',
    ],
  },
})
nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      /#.*/, // All hash links
    ],
  },
})

Not required anymore when using nuxt-link-checker version > v5.0.7

To avoid warnings due to <NuxtLink> handling of links to "/" (app root aka "home") with a configured app.baseUrl, add the baseUrl to the excludeLinks list.

nuxt.config.ts
export default defineNuxtConfig({
  app: {
    baseUrl: '/nuxt-app-root-path-on-server/'
  },
  linkChecker: {
    excludeLinks: [
      '/nuxt-app-root-path-on-server/', // exclude baseUrl to avoid warnings
    ],
  },
})
Was this page helpful?