Next.js
/Beginner
robots.txt
Definition
A text file (`robots.txt`) at the root of a website that explicitly tells search engine crawlers which parts of the site they are allowed to scan, and which they must ignore.
Explain Like I'm New
You don't want Google showing your private `/admin` dashboard or your `/checkout` page in public search results. `robots.txt` is a sign on the door that says 'Google Bot: Do Not Enter this specific room'.
Real World Example
Preventing AI web scrapers from stealing the data on your proprietary `/api` routes by blocking them in `robots.txt`.
Common Use Cases
- •SEO management
- •Crawler control
Interactive Example
Loading Code Playground...
Interview Questions
basic
- Does `robots.txt` physically stop a malicious hacker from accessing a URL?
intermediate
- How do you programmatically generate a `robots.txt` file in Next.js?