🤖 Developer & SEO Guide

Robots.txt Guide: Syntax, AI Bot Blocking & Common Mistakes (2026)

📅 August 2026⏱ 9 min read✍️ ToolLoom Editorial

robots.txt is one of the smallest files on your entire site — often under 200 bytes — and also one of the most widely misunderstood. It doesn't hide pages from Google, it can't stop a determined bot, and one specific directive doesn't even work on the crawler most people write it for. Here's what it actually does.

📋 In This Article
  1. What robots.txt actually is
  2. Correct syntax — user-agent, disallow, allow
  3. Why robots.txt can't reliably hide a page
  4. Blocking AI training crawlers
  5. Crawl-delay — why Google ignores it
  6. Worked example — a complete robots.txt
  7. Why robots.txt is voluntary, not enforceable
  8. Common robots.txt mistakes
  9. Frequently asked questions

What Robots.txt Actually Is

robots.txt is a plain text file placed at the root of a website that tells crawlers which parts of the site they're permitted or asked not to access. It follows the Robots Exclusion Protocol, a standard dating back to 1994, respected voluntarily by well-behaved crawlers — search engines, AI companies, and most legitimate automated tools.

📄
Plain Text File
No special format — just readable directives, one per line.
🚦
Crawl Control
Tells bots which paths they may or may not crawl.
🙋
Voluntary Standard
Respected by convention, not enforced technically.
🗺️
Sitemap Reference
Can point crawlers directly to your sitemap.xml location.

Correct Syntax — User-agent, Disallow, Allow

A robots.txt file is built from groups, each beginning with a User-agent line that names the bot the following rules apply to, followed by one or more Disallow or Allow lines.

User-agent: *
Disallow: /admin/
Disallow: /cart/
Allow: /

Sitemap: https://example.in/sitemap.xml
DirectiveMeaning
User-agent: *Applies the following rules to all crawlers
Disallow: /path/Requests the bot not crawl anything under that path
Allow: /path/Explicitly permits a path, often used to carve out an exception inside a disallowed folder
Sitemap: [url]Points crawlers to your sitemap.xml — can appear anywhere in the file

Why Robots.txt Can't Reliably Hide a Page

This is the single most common misconception about robots.txt: disallowing a page prevents crawlers from fetching its content, but it does not prevent that URL from appearing in search results if other pages link to it. Google can still index and display the bare URL — typically without a proper title or description snippet, since it never actually crawled the page to generate one.

🚨

To reliably keep a page out of search results, use a noindex meta tag on the page itself instead. Counter-intuitively, this requires the page to remain crawlable — if robots.txt blocks the page, Google can't ever see the noindex instruction to honour it.

Blocking AI Training Crawlers

Since generative AI systems began training on web content at scale, many site owners want the option to opt specific pages or their entire site out of that training data collection. This is done the same way as any other bot-specific rule — a dedicated User-agent block per crawler.

Bot NameOperatorPurpose
GPTBotOpenAITraining data collection for GPT models
CCBotCommon CrawlOpen web archive used by many AI labs for training
ClaudeBotAnthropicTraining data collection for Claude models
Google-ExtendedGoogleControls use in Gemini/Bard training, separate from regular Googlebot search crawling
User-agent: GPTBot
Disallow: /

User-agent: CCBot
Disallow: /
💡

Blocking an AI training bot's user-agent doesn't affect your regular Googlebot search crawling or SEO — each bot is addressed independently, so your rules for User-agent: * or Googlebot specifically remain untouched by AI-bot-specific blocks.

Crawl-Delay — Why Google Ignores It

Crawl-delay requests a minimum number of seconds a bot should wait between requests, intended to reduce server load from aggressive crawling. Here's the catch: Google has publicly stated it does not support this directive and ignores it entirely — relying instead on its own crawl-rate algorithm and the manual crawl-rate controls available in Search Console.

CrawlerRespects Crawl-delay?
GooglebotNo
BingbotYes
Most other major crawlersVaries

Worked Example — A Complete Robots.txt

A realistic file for a small e-commerce site, controlling search crawling, opting out of AI training, and referencing the sitemap:

User-agent: *
Disallow: /cart/
Disallow: /checkout/
Disallow: /admin/
Allow: /

User-agent: GPTBot
Disallow: /

User-agent: CCBot
Disallow: /

Sitemap: https://example.in/sitemap.xml
✅

This blocks the cart, checkout, and admin paths from general crawling (which don't need to be indexed anyway), opts out of two major AI training crawlers entirely, and still points every well-behaved bot to the sitemap for efficient discovery of everything else. Build your own with ToolLoom's Robots.txt Generator — select paths and bots to block with a few clicks, no manual syntax needed.

Why Robots.txt Is Voluntary, Not Enforceable

robots.txt carries no technical enforcement mechanism whatsoever — it's a request, honoured by convention and reputation, not a lock. Reputable search engines and most major AI companies generally respect it because ignoring it would damage their standing and invite regulatory or legal scrutiny, but nothing in the protocol itself stops a bot from simply disregarding the file entirely.

⚠️

Never rely on robots.txt to protect genuinely sensitive or private content — use real access control (authentication, server-level restrictions) for anything that actually needs to stay confidential.

Common Robots.txt Mistakes

🤖 Generate Your Robots.txt Instantly — Free

Block AI training bots, control search crawling, and reference your sitemap — no manual syntax required.

Open Robots.txt Generator →

Frequently Asked Questions

A robots.txt file is built from groups of directives, each starting with a User-agent line specifying which bot the rules apply to, followed by one or more Disallow or Allow lines specifying paths. For example: "User-agent: *" followed by "Disallow: /admin/" blocks all bots from crawling the /admin/ path. An optional Sitemap: line pointing to your sitemap.xml can appear anywhere in the file.
Disallowing a page in robots.txt prevents crawlers from fetching its content, but it doesn't prevent the URL itself from being indexed if other pages link to it — Google can still show the URL in results, typically without a text snippet, based on link context alone. To reliably keep a page out of search results, use a noindex meta tag on the page itself instead, which actually requires the page to remain crawlable so Google can see the noindex instruction.
Add a separate User-agent block for each AI crawler's specific bot name with a Disallow: / rule — for example, "User-agent: GPTBot" followed by "Disallow: /" blocks OpenAI's training crawler specifically, while leaving your rules for regular search crawlers like Googlebot untouched. This works only for crawlers that voluntarily respect robots.txt, which includes most major AI companies' bots but isn't universally guaranteed or enforceable.
No. robots.txt is a voluntary standard (the Robots Exclusion Protocol), not a technical access control or legal mechanism. Reputable search engines and most major AI companies generally honour it as a matter of established practice, but nothing technically prevents a bot from ignoring the file entirely — it should never be relied upon as the sole protection for genuinely sensitive or private content.
Google has stated it does not support the Crawl-delay directive and ignores it entirely, instead determining its own crawl rate algorithmically based on server response times and configurable crawl-rate settings inside Google Search Console. Crawl-delay remains part of the broader Robots Exclusion Protocol and is respected by Bing and some other crawlers, so it isn't useless — just ineffective specifically for Googlebot.
If no robots.txt file exists, well-behaved crawlers generally assume they're permitted to crawl the entire site, since there are no restrictions to follow. This is a perfectly normal, valid configuration for most small or mid-sized websites — a robots.txt file only becomes necessary when you specifically need to restrict certain crawlers or paths, reference a sitemap, or block particular bots.
About ToolLoom: We build free tools for Indian students, professionals and creators. All robots.txt generation happens instantly in your browser — nothing is uploaded or stored. Found an error? Email contact@toolloom.in

More from ToolLoom