Robots Txt Directive Reference
Explore common robots.txt directives with practical syntax and examples. Search by directive, purpose, or example to understand crawler rules, control which paths search engines can access, and configure sitemap references correctly.
Look up robots.txt directives
Example robots.txt
Directives
User-agentCore
Specifies which crawler or bot the following rules apply to.
DisallowCore
Specifies paths that a crawler should not crawl.
Disallow: /admin/
AllowCore
Allows a specific path that would otherwise be blocked by a Disallow rule.
Disallow: /assets/
Allow: /assets/images/
SitemapStandard
Provides the full URL of an XML sitemap to help crawlers discover URLs.
HostObsolete
Named the preferred domain (main mirror) for Yandex. Yandex stopped reading it in 2018 and Google never supported it: use a 301 redirect instead.
Crawl-delayNon-standard
Asks crawlers to wait a number of seconds between requests. Bing follows it; Google and Yandex ignore it.
Crawl-delay: 10
CommentsSyntax
Adds human-readable notes that crawlers ignore as directives.
User-agent: *
Disallow: /private/
What Is a Robots.txt Directive Reference?
A Robots.txt Directive Reference is a guide to the rules used in a robots.txt file to communicate crawling preferences to search engine bots. It explains directives such as User-agent, Disallow, Allow, and Sitemap, along with their syntax and typical use cases.
Website owners and SEO professionals use these directives to manage crawler access to specific URL paths and help search engines discover sitemap locations. However, robots.txt is not a security mechanism, and blocking a URL from crawling does not guarantee that the URL will remain out of search results.
How to Use the Robots.txt Directive Reference
Search for a Directive: Enter a directive name, purpose, or example in the Search Directives field.
Review the Category: Check whether the directive is classified as Core, Standard, or crawler-specific.
Understand Its Purpose: Read the description to learn what the directive communicates to crawlers.
Check the Syntax: Review the displayed syntax to understand the expected format.
Study the Example: Use the example to see how the directive appears in a robots.txt file.
Copy an Example: Click Copy Example to copy the relevant example for your configuration.
Example: Robots.txt File Syntax
A robots.txt file can combine crawler-specific rules, allowed paths, blocked paths, and sitemap references.
Example robots.txt file:
User-agent: *
Disallow: /admin/
Disallow: /private/
Allow: /assets/images/
Sitemap: https://example.com/sitemap.xml
In this example:
User-agent: * applies the following group of rules to all crawlers that support the standard.
Disallow: /admin/ requests that crawlers do not crawl URLs under the /admin/ path.
Disallow: /private/ requests that crawlers avoid crawling URLs under the /private/ path.
Allow: /assets/images/ permits crawling of matching image paths that would otherwise be blocked by a conflicting rule, where the crawler supports this behavior.
Sitemap: identifies the location of an XML sitemap that helps crawlers discover URLs.
Place the file at the root of the relevant website host, such as https://example.com/robots.txt. Remember that robots.txt rules are crawler instructions, not access controls. Protect confidential pages using authentication and server-side permissions.