India · Dubai · Delivering worldwide+91 86603 71224info@pyalm.com
Pyalm Labs logo
Free Tools

Robots.txt Guide: Rules, Common Mistakes and How to Block AI Crawlers

How robots.txt works, the syntax and matching rules Google uses, mistakes that de-index sites, and the user-agents for GPTBot, ClaudeBot, Google-Extended and other AI bots.

Editorial disclosure: Pyalm publishes and maintains the products and free tools discussed on this site. Regulatory statements are linked to primary sources where applicable. No independent professional review is claimed unless a reviewer is explicitly named.

robots.txt is a plain text file at the root of your site that tells crawlers which paths they shouldn't fetch. It's simple, powerful and — when it goes wrong — capable of quietly removing a whole site from Google.

The basics

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

User-agent: GPTBot
Disallow: /

Sitemap: https://www.example.com/sitemap.xml
  • User-agent — which crawler the group applies to (* = all).
  • Disallow — paths not to crawl. Disallow: (empty) allows everything; Disallow: / blocks everything.
  • Allow — exceptions inside a disallowed path.
  • Sitemap — the full URL of your sitemap.
  • matches any characters; $ anchors the end (/.pdf$).

How Google picks a rule

  1. It uses the most specific user-agent group that matches (e.g. Googlebot over *).
  2. Within that group, the longest matching path wins.
  3. If an Allow and a Disallow are equally long, Allow wins.

robots.txt is not a privacy tool

  • Blocked pages can still appear in search (as a bare URL) if other sites link to them.
  • Malicious bots ignore it — and it advertises your "hidden" paths.
  • To keep a page out of Google, allow crawling and add <meta name="robots" content="noindex">.
  • To protect content, use authentication.

AI crawlers

User-agent Operator Purpose
GPTBot OpenAI Model training
OAI-SearchBot OpenAI ChatGPT search results
ChatGPT-User OpenAI Browsing on a user's request
ClaudeBot Anthropic Model training
Claude-SearchBot Anthropic Claude search
Google-Extended Google Gemini / Vertex AI training (doesn't affect Search)
Applebot-Extended Apple AI training
PerplexityBot Perplexity Answer engine index
CCBot Common Crawl Open dataset used by many models

Blocking training bots keeps your content out of future models; blocking search/answer bots can reduce your visibility in AI-powered search. Many businesses block training crawlers but allow search ones. It's a business decision — there's no universally right answer.

Build and test yours

The free Robots.txt Generator & Tester lets you block common private areas, pick which AI crawlers to block, add custom rules and your sitemap — then test any URL against the rules for Googlebot or any AI bot, using Google's matching logic. You can also paste an existing robots.txt to test it.

Mistakes that hurt

  • Disallow: / left over from a staging site — the classic de-indexing disaster
  • Blocking CSS and JS files, so Google can't render your pages
  • Blocking pages you've also marked noindex (Google can't see the noindex)
  • Putting robots.txt anywhere except the root of each host

SEO and infrastructure, built in

Pyalm builds SEO-first websites for businesses in India and the UAE — technical SEO, structured data, sitemaps, correct DNS and email authentication, and fast hosting — so these checks pass from day one.

WHOIS Lookup | DNS Lookup | Sitemap Generator | Robots.txt Generator | SERP Preview | All free tools

Keep reading

More from Pyalm

Nov 27, 2026

Prescription Abbreviations: What OD, BD, TDS, SOS and 1-0-1 Mean

A plain-English list of prescription abbreviations: dose timing (OD, BD, TDS, QID), when to take (AC, PC, HS, SOS), routes, forms, the 1-0-1 dose grid and abbreviations to avoid.

Nov 27, 2026

Handwritten vs Typed Prescriptions: Which Is Safer?

Why legibility matters in prescribing, what changes when clinics move from handwritten to typed or electronic prescriptions, and how to keep a handwritten signature.

Nov 27, 2026

How to Write a Prescription in India: Format and Rules

A practical prescription format for doctors in India: required details, generic names in capitals, the 1-0-1 grid, Schedule H and controlled drugs, and keeping records.

Nov 27, 2026

Prescription Pad Design: Letterhead Template for Clinics

What a professional prescription letterhead should include, paper size, layout, bilingual Arabic and English pads, QR codes for verification and printing tips.

Nov 27, 2026

Prescription Errors: 10 Common Mistakes and How Clinics Prevent Them

The ten prescription mistakes that cause dispensing errors, from illegible names and decimal points to missing durations, and simple fixes for clinics.

Oct 16, 2026

How to Format and Validate JSON (and Fix the 6 Most Common Errors)

Why JSON breaks, how to read a validator's error message, and a quick routine for pretty-printing, minifying and fixing JSON from APIs, logs and config files.

Try the free Robots.txt Checker

Pyalm builds SEO-first websites for businesses in India and the UAE — technical SEO, structured data, fast hosting and the right DNS and email setup from day one.

Open Robots.txt Checker See website development All free tools