Understanding robots.txt Syntax & Search Crawler Specifications
robots.txt file is a plain text configuration file placed in the root directory of a web server to instruct search engine crawlers (Googlebot, Bingbot, YandexBot) which paths they may crawl. It operates under the Robots Exclusion Protocol (REP) using standard directives: User-agent, Disallow, Allow, and Sitemap.# Standard robots.txt File Format: User-agent: * Disallow: /admin/ Disallow: /api/ Allow: /api/public Sitemap: https://example.com/sitemap.xml
- `User-agent`: Defines the specific spider or crawler bot targeted by rule blocks
- `Disallow`: Prevents matching crawler bots from scanning specified directory paths
- `Allow`: Overrides Disallow rules to grant access to specific sub-directories or files
- `Sitemap`: Declares the absolute XML sitemap URL address for efficient indexing