# Robots.txt Generator for Next.js

> A robots.txt for Next.js apps: allow content, block /api and build artifacts, and reference your sitemap.

Free tool: https://mars.cx/tools/robots-txt-generator-for-nextjs

Next.js can serve robots.txt from app/robots.ts or public/. Here is a clean set of rules for a typical SaaS or content site.

## How to use

1. Choose allow-all or block specific paths.
2. Add your sitemap URL.
3. Copy the robots.txt to your site root.

## FAQ

### Where does robots.txt go?

At the root of your domain, e.g. https://example.com/robots.txt

### Does it prevent indexing?

robots.txt controls crawling, not indexing. Use a noindex meta tag to keep a page out of results.

### Is it free?

Yes, free with no signup.

Provided by MarsGeo — https://mars.cx