What is robots.txt?

Robots.txt is a plain text file at yoursite.com/robots.txt that tells crawlers such as Googlebot, Bingbot and AI bots which parts of a site they may fetch. It is a request, not a lock: well behaved crawlers follow it, bad ones ignore it. Its main job is to keep crawlers away from pages that waste their time, such as search result pages, carts and admin areas.

Robots.txt explained: definition, where it sits in the buying journey and three key points, by Oftsaid
Robots.txt at a glance. Free to share with a link back to this page.

Where Robots.txt sits in the buying journey

DiscoverSomeone has a question
ConsiderThey compare options
ConvertThey act or enquire
KeepYou measure and grow

Topic: SEO

How it connects to other terms

XML sitemapTechnical SEOCrawl budgetllms.txtRobots.txtNoindexAI crawler

What does a robots.txt file look like?

Each block names a crawler (User agent) and the paths it should not fetch (Disallow). An asterisk means every crawler. A simple file for a small business site looks like this: User agent: * then Disallow: /wp admin/ then a Sitemap line pointing to your XML sitemap.

Most small sites need very little. The default file most platforms create is usually fine; trouble starts when someone adds a rule they do not understand.

Does robots.txt keep a page out of Google?

No, and this is the most common mistake. Google's robots.txt guide says plainly that it is not a mechanism for keeping a web page out of Google. A blocked page can still be indexed if other sites link to it; Google just cannot read it, so it may show the bare address with no description.

To keep a page out of search results, let Google crawl it and add a noindex tag, or put it behind a password.

What should you never block?

  • CSS and JavaScript files your pages need to display. Google renders pages like a browser; if it cannot load them, it may misread the page.
  • Pages you want ranked. A single 'Disallow: /' left over from a staging site blocks everything.
  • Images you want in Google Images.

What is the difference between robots.txt, noindex and nofollow?

  • Robots.txt: asks crawlers not to fetch a page or folder. The page can still be indexed from links.
  • Noindex: a tag on the page that tells Google not to show it in results. Google must be able to crawl the page to see it.
  • Nofollow: a link attribute that tells Google not to pass ranking credit through that link.

Use noindex to keep a page out of search, robots.txt to manage crawling, and nofollow for paid or untrusted links.

Should you block AI crawlers in robots.txt?

Only if you do not want to be used or cited by AI tools, and the answer differs by crawler. The top results we checked, including Cloudflare's explainer, do not cover AI crawlers at all.

  • Google-Extended controls whether Google can use your content for Gemini training and grounding. Google's crawler documentation says it does not affect inclusion or ranking in Google Search.
  • GPTBot is OpenAI's training crawler. OAI-SearchBot is the one that finds pages for ChatGPT search results; OpenAI's crawler page explains each.
  • ClaudeBot and PerplexityBot are the crawlers for Anthropic and Perplexity.

For a business that wants to be recommended, blocking AI crawlers mostly removes you from the answers your buyers read. Our own robots.txt allows all of them for that reason, and our free AI visibility checker shows what yours allows. Publishers who sell their content may reasonably choose differently.

Written after checking the pages that rank for this term in November 2026. It covers what they leave out.

What is an example?

A common relaunch mistake: a developer copies the staging server's robots.txt, which says 'Disallow: /' for every crawler, to the live site. Within days Google stops crawling, and traffic slides. Removing that one line and resubmitting the sitemap in Search Console is the fix, which is why robots.txt belongs on every launch checklist.

How often do people search for "robots.txt"?

About 6,600 searches a month in India and 6,600 in the US, for the phrase "robots.txt", according to Semrush keyword data from November 2026.

Interest in India has been falling over the last 12 months. Ranking for it in India is held by established sites, so newer sites do better targeting longer questions around it (Semrush difficulty 79 out of 100). Advertisers bidding on it in India pay about $0.30 per click on Semrush estimates, which tells you there is commercial intent behind the search.

MarketMonthly searchesDifficulty (0 to 100)
India6,60079
United States6,60014

India, last 12 months

Source: Semrush keyword data for India and the US, November 2026. Volumes are estimates and change month to month.

What else do people ask about robots.txt?

Where does robots.txt go?

At the root of the domain, for example https://yoursite.com/robots.txt. A file in a subfolder is ignored.

How do I test my robots.txt?

Search Console shows the version Google fetched and any errors in its robots.txt report.

Is robots.txt a security tool?

No. It is public, so never list private folders in it hoping to hide them.