Skip to content

robots.txt missing

Every site should have a robots.txt file at /robots.txt. Without one, crawlers have no guidance about which paths to index and which to skip. Most crawlers will index everything by default, but you lose the ability to protect internal routes, reduce crawl budget waste on low-value pages, and point crawlers to your sitemap.

Create a robots.txt in the location your framework serves static files from.

The recommended approach is app/robots.ts, which Next.js compiles to /robots.txt automatically at build time:

app/robots.ts
import type { MetadataRoute } from 'next'
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: '*',
allow: '/',
disallow: ['/api/'],
},
],
sitemap: 'https://yourdomain.com/sitemap.xml',
}
}

Alternatively, place a static public/robots.txt in your project root.

Create public/robots.txt:

User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml

Create static/robots.txt:

User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml

Create public/robots.txt:

User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml

For programmatic control over multiple environments, use the @nuxtjs/robots module.

Create public/robots.txt:

User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml

Place robots.txt in the root directory of your site, alongside index.html:

User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml

Check the file is accessible at its standard path:

Terminal window
curl -I https://yourdomain.com/robots.txt

The response should return 200 OK. Check the content is correct:

Terminal window
curl https://yourdomain.com/robots.txt

Re-run orino audit to confirm the check passes.