Skip to content

What it is

robots.txt is a plain-text file at /robots.txt that tells crawlers which paths they may fetch and where the sitemap is.

The syntax is minimal:

User-agent: *
Disallow: /admin/
Disallow: /private/
Sitemap: https://example.com/sitemap.xml

User-agent sets the scope. * matches all crawlers. Googlebot matches Google only. Disallow: /admin/ blocks the path; Allow: /admin/public/ re-opens a subtree. Sitemap: is a hint, not a rule. Empty Disallow: allows everything.

robots.txt is advisory. A crawler that ignores it can still fetch any URL. Major search engines honor it; scrapers often do not. It is not a security control, it is a politeness convention.