What is robots.txt?
The robots.txt file is a text file in the root directory of a website that tells search engines and other crawlers which areas they may fetch. It controls crawling, but it does not protect content and is not a way to remove pages from the index.

robots.txt: definition and meaning
The robots.txt file is a simple text file in the root directory of a domain, for example at example.com/robots.txt. It is based on the Robots Exclusion Protocol, which was standardized in 2022 as RFC 9309. Reputable crawlers fetch the file before visiting a website and follow the rules it contains.
Every subdomain needs its own robots.txt, and the file is publicly readable: anyone can open it and see which paths are excluded. That makes it unsuitable for hiding confidential areas. Access protection, logins, and permission management are responsible for that.
How robots.txt works
The file consists of blocks. With User-agent you define which crawler a rule applies to, with Disallow you block paths, and with Allow you permit exceptions. Google evaluates only the first 500 KiB of the file and recognizes only these directives plus the Sitemap line. Instructions such as crawl-delay are ignored.
The difference between crawling and indexing is important. A page blocked with Disallow can still appear in search results if other pages link to it, though without a description. If a page should be removed from the index, it needs a noindex and must not be blocked, otherwise the crawler never sees the noindex.
- User-agent: * – applies to all crawlers
- Disallow: /cart/ – blocks a path from crawling
- Allow: – permits an exception inside a blocked path
- Sitemap: – gives the full URL of the XML sitemap
Real-world example: a relaunch with consequences
A skilled-trades business has its website rebuilt. On the test server, a Disallow blocks the entire site so nobody finds the unfinished version. At launch the file is accidentally copied over. A few weeks later, inquiries from Google drop noticeably because crawlers are no longer allowed to fetch anything.
The fix is a corrected file and a check in Google Search Console; after that it takes a while until Google fetches the pages in full again. That is why the robots.txt belongs on every go-live checklist. Test environments should additionally be protected with a password, not just with Disallow.
Limits and common mistakes
The robots.txt file is a request, not a security measure: reputable crawlers follow it, malicious bots simply ignore it. It is also error-prone, because a single misplaced line can lock out entire sections without the problem being obvious on the website itself.
- Disallow: / on the live site blocks the entire website
- Blocking CSS and JavaScript files: Google cannot render the page correctly
- Trying to “remove” pages via robots.txt: noindex is responsible for that
- Listing confidential paths: the file reveals them to every reader
AI crawlers and implementation
Many site owners now also use robots.txt to allow or block AI crawlers such as GPTBot, ClaudeBot, or PerplexityBot. The Google-Extended token controls use for Google's Gemini models; regular Google Search is unaffected. Nano Concepts reviews the robots.txt file during technical SEO audits and aligns it with your goals.
Frequently asked questions about robots.txt
In the root directory of the domain, that is, at yourdomain.com/robots.txt. It is ignored in subfolders. Each subdomain needs its own file, and it must be served as plain text.
No, it only prevents crawling. A blocked URL can still appear in the index without a description. To remove a page, use a noindex meta tag (the page must stay crawlable for that), password protection, or, in urgent cases, the removal tool in Search Console.
No. If the file is missing, crawlers assume that everything may be fetched and crawl the entire website. It is still recommended, to exclude cart, login, or search pages and to point to the sitemap.
Yes, by blocking their user-agent names with Disallow. The providers document their crawlers and state that they respect the file. There is no technical guarantee, though. Anyone who really wants to protect content also needs access protection.
Matching services

Technical SEO Audit
A review of your website's crawling, indexing, structure and load time – with a prioritized action plan and implementation.
Learn more
Technical SEO & Relaunch
Relaunch and technical SEO with a redirect plan, load-time optimization and monitoring – together with LOMA DESIGN.
Learn more
Generative Engine Optimization (GEO)
Citable facts, structured data and open technology – so AI searches like ChatGPT and Perplexity use you as a source.
Learn moreRelated terms
Relevant for these industries
Related magazine articles

WCAG 2.2 and BITV 2.0 in Practice: Implementing Web Accessibility
How to implement a website to WCAG 2.2 AA: new criteria, clear responsibilities across design, development and editorial, effective testing and a checklist for your relaunch.
Read more
SEO and Search Visibility: Technology, Content and AI Search
Good rankings come from technology, content and consistent measurement – and increasingly from whether AI search tools use your pages as a source. Here is how your website becomes visible and generates qualified inquiries.
Read more
How to Configure GA4: Events, Key Events and Rollout
Google Analytics 4 only delivers reliable numbers when events, key events and consent are planned. Here is how to build a tracking plan that rolls out cleanly.
Read more