# What Is robots.txt? Definition and Example

> robots.txt is a text file at a site's root that tells crawlers which URLs they may request. Syntax, precedence rules and AI crawler examples.

Source: https://mentionx.ai/glossary/robots-txt  
Author: Dipuck Jones, founder of MentionX  
Updated: 31 October 2026  
Level: Beginner

**robots.txt is a plain text file at the root of a website (for example `example.com/robots.txt`) that tells crawlers which parts of the site they may request.** It follows the Robots Exclusion Protocol, standardised as RFC 9309 ([RFC Editor](https://www.rfc-editor.org/rfc/rfc9309.html)). It controls crawling, not indexing: to keep a page out of Google, use `noindex` instead ([Google](https://developers.google.com/search/docs/crawling-indexing/block-indexing)).

> **Key takeaways**
>
> - robots.txt is a plain text file at your site root that tells crawlers which paths they may fetch.
> - Each group applies to the user agent it names; the most specific matching group wins under Google's rules.
> - It controls crawling, not indexing; use noindex to keep a page out of results.
> - In MentionX data, 0 of 9,750 citations pointed to llms.txt or other .txt files.

*Checked on 31 October 2026. "Our view" marks MentionX opinion. Ledgerline is a fictional company used for illustration.*

## What does it look like?

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

User-agent: GPTBot
Disallow: /

User-agent: OAI-SearchBot
Allow: /

Sitemap: https://example.com/sitemap.xml
```

## How do crawlers read it?

According to Google's documentation ([robots.txt spec](https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec)):

- A crawler follows the **most specific** user-agent group that matches it and ignores the others.
- Within a group, the **longest matching path** wins. When rules conflict, the least restrictive one applies.
- Google generally caches the file for up to 24 hours.

## Why does it matter for AI visibility?

AI companies publish separate user agents for training and for search, such as OpenAI's GPTBot and OAI-SearchBot ([OpenAI](https://developers.openai.com/api/docs/bots)). A careless blanket rule can block the very agents that put you in AI answers. Review the file whenever your AI policy changes.

## What are the common mistakes?

- A `Disallow: /` under `User-agent: *` left over from staging.
- Blocking the CSS or JS needed to render pages.
- Assuming a block removes pages that are already indexed.

## How do you test your file?

Open `yourdomain.com/robots.txt` in a browser to see what's live. Use the robots.txt report in Google Search Console to check how Google fetched it. For each AI agent you care about, read through the groups and confirm which one applies, remembering that a named group overrides `User-agent: *` completely for that agent.

## From MentionX data: what engines actually cited

**Method.** Read only aggregate queries over MentionX scans from 22 August to 29 October 2026 (UTC): 2,217 engine runs (2,154 completed) across 18 anonymised projects and six engines.

| Cited URL type | Share of 9,750 citations |
| --- | --- |
| Blog or article | 19.6% |
| Homepage | 10.0% |
| Review page | 2.7% |
| Docs | 2.6% |
| Pricing | 1.9% |
| Wikipedia | 1.6% |

We hold no crawler logs, so we can't show how bots read robots.txt. We can show where engines' citations landed once crawling had done its work.

No citation pointed to a .txt file of any kind, including llms.txt. Ordinary pages carried the weight.

*Our view:* robots.txt is a gatekeeper, not a ranking signal. Get it right so crawlers reach the pages in this table, then spend your time on those pages.

**Limits.** A convenience sample of mostly B2B software projects, run through engine APIs, which can behave differently from the consumer apps. Perplexity, Copilot and DeepSeek figures come from a single day (26 October 2026), so treat them as a snapshot, not a trend.

## Worked example: Ledgerline's robots.txt review

*Ledgerline is a fictional accounts payable tool. Figures are illustrative.*

Ledgerline's file has grown over five years to 60 lines, with rules for crawlers that no longer exist and a `User-agent: *` group that disallows `/resources/`, where all its guides now live.

The team rewrites it to 14 lines: a general group allowing everything except the app and admin paths, a GPTBot group reflecting the legal team's decision, and a sitemap line. They test the file in Search Console's robots.txt report and confirm the guides are fetchable.

> **Pro move:** Search your robots.txt for any Disallow that matches a folder you've since used for public content. Old rules outlive site migrations.

## How specific should rules be?

Under Google's documented rules, the most specific matching group applies to a crawler, and within a group the longest matching path rule wins ([Google](https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec)). That means a crawler named in its own group ignores the `User-agent: *` group entirely, so repeat any shared rules inside named groups. RFC 9309 sets out the same group logic for crawlers that follow the standard ([RFC 9309](https://www.rfc-editor.org/rfc/rfc9309.html)).

## Common questions

**Does robots.txt block indexing?** No. A blocked URL can still be indexed if other pages link to it. Use noindex for that ([Google](https://developers.google.com/search/docs/crawling-indexing/block-indexing)).

**Do all AI crawlers obey it?** Major vendors say their crawlers do; user triggered fetchers may behave differently, so read each vendor's documentation.

**Where must the file live?** At the root of each host, such as `https://example.com/robots.txt`.

## Related

- [GPTBot](https://mentionx.ai/glossary/gptbot)
- [Robots.txt for AI crawlers](https://mentionx.ai/learn/technical/configure-robots-txt-ai-crawlers)

## Frequently asked questions

### Does robots.txt stop a page from being indexed?

Not reliably. A blocked URL can still be indexed without its content if other pages link to it. Use noindex to keep a page out of Google.

### How quickly do changes apply?

Google generally caches robots.txt for up to 24 hours.

### Can I set rules for AI crawlers?

Yes. Add a group for each user agent, such as GPTBot, OAI-SearchBot, PerplexityBot or Google-Extended.

---

Written and reviewed by Dipuck Jones for MentionX Academy. The HTML version of this page: https://mentionx.ai/glossary/robots-txt
