A robots.txt file is only a few lines long, which is exactly why its mistakes are so costly. There is no warning when you upload one: the file starts giving instructions to every crawler that visits, and if one is wrong, the crawler obeys it quietly. Sites have vanished from search results because of a single line meant only for a test version of the site.

This guide walks through the mistakes that do the damage: the one line that blocks everything, the secret paths that should never be written down, the right file uploaded to the wrong address, and two expectations the file cannot meet. It uses the free Robots.txt Generator on Ovatly, which builds the file from visual rule groups, and the Robots.txt Tester, which checks a file before it goes live.

Contents

  • Quick answer
  • Why one short line can block everything
  • The mistake that advertises what you wanted to hide
  • Right rules, wrong address
  • Two expectations the file cannot meet
  • How to build a safe file, step by step
  • Worked example: the safe file and the accident
  • Limitations: what robots.txt cannot do
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

The dangerous mistakes are easy to state. Never put Disallow: / in the group for all crawlers unless you want the whole site blocked: Disallow works on prefixes, and the slash is the prefix of every path. Never list secret paths, because anyone can read the file. Upload it to the root of the host; each subdomain needs its own file. Build it with the Robots.txt Generator, then test it with the Robots.txt Tester before it goes live.

Why one short line can block everything

Disallow does not name individual pages. It tells crawlers not to fetch paths under a prefix. Disallow: /admin/ blocks everything that begins with /admin/, which is the behaviour you want for an admin area. The same logic makes Disallow: / so destructive: every path on your site begins with a slash, so a group pairing the wildcard user agent with that line instructs every crawler to fetch nothing at all.

This line usually arrives by accident. A common route is the staging site: blocking everything is correct for a test copy, and the file then travels with the site when it launches. Another is editing by hand, where a path gets trimmed one character too far. Either way, the file looks plausible at a glance, which is why it survives review. The defence is to read the wildcard group (user agent *) with fresh eyes before uploading, and ask of every Disallow line: what begins with this prefix?

The opposite misunderstanding exists too. An empty Disallow line, Disallow: with nothing after it, blocks nothing for that group, and the generator only writes Disallow lines for paths you actually enter. The risk is never the empty line; it is the short one.

The mistake that advertises what you wanted to hide

A robots.txt file is public. Anyone can open it in a browser. That is why the generator's guidance is blunt: never list secret paths in it. Writing Disallow: /client-invoices/ does not protect that folder; it announces the folder exists and tells every reader where to look.

The deeper point is that robots.txt is not a security tool at all. It controls crawling: it asks well-behaved crawlers not to fetch something. It does not lock the path, require a login, or stop a person typing the address directly. If a path must stay private, protect it with authentication on the page itself, and keep robots.txt for steering crawlers away from areas useless for them to fetch, such as admin sections and temporary folders.

Right rules, wrong address

A correct file in the wrong place does nothing, and the failure is silent. The file must live at the root of the host: for a site on example.com, the working address is https://example.com/robots.txt. A copy placed inside a subfolder is not read as the site's robots.txt, so your blocking never happens.

Subdomains multiply the problem. Each subdomain needs its own file, so the rules you wrote for the main domain do not govern a subdomain such as shop.example.com or blog.example.com. A staging or shop subdomain with content you do not want crawled needs its own file at its own root. Sites that discover this late usually find the leak was a subdomain nobody remembered to cover. The placement rules are set out in full in Where Does Robots.txt Go?.

Two expectations the file cannot meet

The first is crawl-delay. Some crawlers honour it: Bing is the example the tool gives. Googlebot ignores it. A file that leans on crawl-delay to slow Google's crawler leans on a rule its main reader does not follow.

The second is removal. Blocking a page in robots.txt does not take it out of Google. A disallowed page can still appear in search results if other sites link to it, and blocking a page that is already indexed usually keeps the URL in the results without a snippet. For deindexing, the tools are a noindex tag on the page or removing the page itself. Expecting robots.txt to do it leaves the URL visible, possibly for longer, because the crawler can no longer fetch the page.

How to build a safe file, step by step

  1. Open the Robots.txt Generator. In the first group, list the user agents the rules apply to, using * for all crawlers.
  2. Add the Disallow paths to block, one per line, reading each one as a prefix: everything beginning with those characters is blocked for that group. Add Allow paths only to reopen part of a blocked section; when both match, the longest pattern wins.
  3. Add another group only if one crawler needs different rules.
  4. Add your sitemap URL, then copy or download the generated file.
  5. Before uploading, run the file through the Robots.txt Tester with a few real paths, especially pages you most need crawlers to reach. Then place the file at the root of the host, and repeat for each subdomain.

Worked example: the safe file and the accident

The generator's worked example builds this file from one group, user agent *, with Disallow paths /admin/ and /tmp/ and the sitemap added:

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

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

That file blocks two areas and nothing else. Now compare the accident version, produced when the first path loses its folder name during an edit:

User-agent: *
Disallow: /

The second file is shorter, tidier and catastrophic: the prefix is now the whole site. Nothing in either file announces which one you meant, which is what the tester step is for: check a normal page path, such as your homepage, against the finished file and read the verdict.

Limitations: what robots.txt cannot do

Robots.txt controls crawling only. It is not indexing control, because a blocked page can still be listed from its links. It is not security, because it neither hides paths nor restricts who can open them. Nor is it obeyed by every visitor: cooperating crawlers follow it, and anything that chooses to ignore it is unaffected. Treat the file as traffic direction for well-behaved crawlers, and use other tools for privacy, removal and access control.

Common mistakes

  • Leaving Disallow: / in the wildcard group after a staging phase, which blocks the entire site for every crawler.
  • Listing secret paths to keep them hidden, which publishes their addresses to anyone who reads the file.
  • Uploading the file to a subfolder instead of the root of the host, where it is never read as robots.txt.
  • Assuming one file covers subdomains, when each subdomain needs its own file at its own root.
  • Expecting crawl-delay to slow Googlebot, which ignores it, even though some other crawlers honour it.
  • Expecting a block to remove a page from Google, when a blocked, indexed page usually stays listed without a snippet.

FAQs

What happens if I put Disallow: / in the group for all crawlers? Disallow tells crawlers not to fetch paths under a prefix, and the slash is the prefix of every path on the site. That one line blocks the whole site for every crawler in the group.

Can robots.txt remove a page from Google? No. Blocking a page that is already indexed usually keeps the URL in results without a snippet. Use a noindex tag or remove the page for deindexing.

Does an empty Disallow line block anything? "Disallow:" with nothing after it means nothing is blocked for that group. The generator only writes Disallow lines for paths you actually enter.

Is it safe to list private folders in robots.txt to keep them hidden? No. Anyone can read your robots.txt file, so listing a secret path advertises it. Blocking a path controls crawling; it is not security.

How do I check my file before it goes live? Use the Robots.txt Tester on this site with the generated content and a few real paths from your site, especially anything you meant to keep crawlable.

Conclusion

Almost every robots.txt disaster is a small file read too quickly. Read the wildcard group line by line, treat every Disallow as a prefix, keep secrets out of the file entirely, and put the finished file at the root of each host it governs. Building with the Robots.txt Generator and testing before upload turns a silent risk into a two-minute check. More guides sit in the SEO Tools category.