What Is robots.txt?
robots.txt is a plain-text file at the root of a website that tells crawlers which paths they may and may not request. It controls crawling only. It does not control indexing, it does not secure anything, and every rule in it is public to anyone who opens the file.
Key facts
- The file always lives at the root: example.com/robots.txt.
- It controls crawling, not indexing. Blocked URLs can still appear in results.
- It is public. Never use it to hide sensitive paths.
- Mainstream crawlers respect it; malicious ones do not.
What should a robots.txt file do?
For most sites, very little, and that is correct.
- Allow crawling of everything that should be found.
- Block genuinely useless paths, such as internal search results and infinite filter combinations.
- Point to the XML sitemap.
- Say nothing about admin paths you would rather nobody knew about.
The mistake that takes a site out of search
A staging site is built with Disallow: / to keep it out of search. The site goes live, the file comes with it, and the whole site is blocked from crawling. It is one of the most common causes of a sudden total traffic loss after a launch.
The related trap: blocking a page in robots.txt to remove it from Google. Because the crawler can no longer fetch the page, it never sees the noindex tag, and the URL can stay in the results indefinitely.
robots.txt FAQs
How do I remove a page from Google?
Allow crawling and add a noindex tag to the page, or remove the page and return a 404 or 410. Blocking in robots.txt achieves the opposite of what people expect.
Should I block AI crawlers in robots.txt?
Only if you accept the consequence. Blocking them removes your site from those tools' answers, which for most businesses is worse than being quoted. It is a reasonable choice for publishers whose business is the content itself.
Does robots.txt affect ranking?
Not directly, but a mistake in it can stop pages being crawled, which prevents ranking entirely. It is worth checking after any launch, migration or platform change.
Next in the glossary
Crawling
Crawling is the process by which a search engine discovers and fetches the pages on a website. A crawler follows links...
Indexing
Indexing is the step where a search engine stores and organises a page it has crawled, so that the page can be returned...
Technical SEO
Technical SEO is the work that lets search engines and AI crawlers reach, read and render a website reliably. It covers...
llms.txt
llms.txt is a proposed plain-text file placed at the root of a website that points AI tools at the pages the owner...
XML Sitemap
An XML sitemap is a file listing the pages a site owner wants search engines to crawl, together with when each was last...