Robots & Sitemap Checker

Guides › robots.txt basics

robots.txt syntax: every directive explained

robots.txt is a plain-text file served at the root of a host (https://example.com/robots.txt). It applies only to that exact protocol, host and port. blog.example.com needs its own file. The format is standardised as RFC 9309 (2022).

DirectiveMeaningSupported by
User-agentStarts a group: which crawler(s) the following rules apply to. * means any crawler without a more specific group.All
DisallowPath prefix the crawler shouldn't fetch. An empty value means nothing is disallowed.All
AllowPath prefix explicitly allowed. Used to carve exceptions out of a Disallow.Google, Bing, most modern crawlers (RFC 9309)
SitemapAbsolute URL of a sitemap. Not tied to a group; it can appear anywhere.Google, Bing, Yandex, others
Crawl-delaySeconds between requests.Bing, Yandex. Ignored by Google.
NoindexNot a valid robots.txt rule.Google dropped unofficial support in Sept 2019

A complete example

# Default rules
User-agent: *
Disallow: /cart/
Disallow: /search
Allow: /search/help

# Opt out of AI training
User-agent: GPTBot
Disallow: /

Sitemap: https://example.com/sitemap.xml

Rules that trip people up

See also: Allow vs Disallow precedence and wildcards.

Check your site now

Related

Allow vs Disallow: which rule wins in robots.txt?robots.txt wildcards: how * and $ workNoindex in robots.txt doesn't work: what to do insteadCrawl-delay in robots.txt: who honours itWhat happens when robots.txt returns 404, 403 or 500

More free tools from Swift Labs

OG Preview Tool
Preview links on Facebook, LinkedIn, X and Slack, and audit Open Graph tags.
Email DNS Check
Check SPF, DKIM, DMARC and MX records in seconds.
DeadLinkPatrol
Find broken links across your whole site.