Skip to main content
2Marketing logo
FREE CHECK Are AI engines recommending you? See if ChatGPT, Gemini and Perplexity mention your business. Check AI visibility →
Classic SEO + AI search, one team647-558-8875
Call us now647-558-8875 Free proposalReply within 24h Book a call30 min, free Free AI reportSee how you rank
TALK TO A STRATEGIST 647-558-8875 info@2marketing.com Canada · USA · UAE · Europe
Call Book Free ProposalNo obligation
Glossary · RTechnical SEOUpdated November 25, 2026

Robots.txt

Dr. Salman SabirReviewed by the 2Marketing team2 min read
Definition

Robots.txt is a plain text file placed at the root of a website, such as example.com/robots.txt, that tells search engine crawlers and other bots which parts of the site they may or may not crawl.

It follows the Robots Exclusion Protocol, which Google and other major search engines respect. Malicious bots often ignore it, so it is not a security tool.

Basic syntax

A robots.txt file is made of groups of rules:

  • User-agent: which crawler the rules apply to, such as Googlebot, or * for all.
  • Disallow: a path the crawler should not crawl, such as /wp-admin/.
  • Allow: an exception inside a disallowed path.
  • Sitemap: the full URL of your XML sitemap.

A typical WordPress file blocks /wp-admin/ but allows /wp-admin/admin-ajax.php, and lists the sitemap.

Robots.txt does not stop indexing

Blocking a URL stops crawling, not indexing. Google can still index a blocked URL if other pages link to it, showing it with no description. To keep a page out of search results, use a Noindex Tag tag and leave the page crawlable so Google can see the tag.

AI crawlers

Robots.txt is also how you control AI bots. GPTBot (OpenAI training), OAI-SearchBot (ChatGPT search), ClaudeBot, PerplexityBot and Google-Extended (Gemini training) each have their own user-agent. Blocking search-related AI bots can remove your site from AI answers, so decide bot by bot rather than blocking all of them. See AI Crawler.

Common mistakes

  • “Disallow: /” left on after launching a site, which blocks everything.
  • Blocking CSS or JavaScript files Google needs to render pages.
  • Using robots.txt to hide private content, which only advertises where it is.
  • Case and trailing slash mistakes in paths.

Test your file with the robots.txt report in Google Search Console. Our technical SEO audits review it on every project.

FAQ

Do I need a robots.txt file?

It is not required. Without one, crawlers assume they may crawl everything. Most sites still use one to list the sitemap and block admin areas.

Does Google support crawl-delay?

No. Google ignores crawl-delay. Bing and some other crawlers support it.