T
ToolPrime

robots.txt for Nuxt Applications

robots.txt template for Nuxt.js (Vue.js) applications. Handles both SSR and static generation modes.

robots.txt

User-agent: *
Disallow: /_nuxt/
Disallow: /api/
Disallow: /404
Allow: /_nuxt/builds/
Allow: /_nuxt/entry.*

Sitemap: https://example.com/sitemap.xml

Line-by-Line Explanation

User-agent: * — applies to all crawlers

Disallow: /_nuxt/ — blocks Nuxt build artifacts and chunks

Disallow: /api/ — blocks server API routes

Disallow: /404 — prevents the error page from being indexed

Allow: /_nuxt/builds/ and /_nuxt/entry.* — ensures essential assets are accessible for rendering

Sitemap — directs crawlers to the sitemap

Best Practices for Nuxt

Build a custom robots.txt for your Nuxt site

Open robots.txt Generator

Frequently Asked Questions

How do I add robots.txt in Nuxt 3?
Use the @nuxtjs/robots module (recommended), place a file in /public, or create a server route at server/routes/robots.txt.ts for dynamic generation.
Does Nuxt SSR need a restrictive robots.txt?
No. Nuxt SSR delivers full HTML to crawlers, so a minimal robots.txt is usually sufficient. Only block internal API routes and build artifacts.
Should I use static generation or SSR for SEO?
Both work well for SEO. Static generation (nuxt generate) is faster and more reliable for crawlers. SSR is better for frequently updated content or personalized pages.

Related Templates