Hidden at the root of almost every website is a small text file called robots.txt. Most business owners have never heard of it, and most never need to think about it — until one wrong line in it makes their whole website invisible to Google. This guide explains what robots.txt does, what yours should contain, and the mistake that has hidden more websites than any other.

What robots.txt actually does

Robots.txt is an instruction file for search engines. When Google visits your site, it reads this file first to learn which parts of the site it is allowed to crawl. A typical file says something like: “You may crawl everything, and here is where my sitemap is.” It can also say: “Do not crawl my admin area, my search results pages, or my private files.” That is all it does — it guides crawlers, politely. It is not security: anyone can read the file, and a malicious visitor will ignore it entirely. Think of it as a sign on a shop door, not a lock.

What a good robots.txt looks like

For most UK small-business websites, a good robots.txt is very short. It allows all search engines to crawl the site, disallows the admin and login areas, and points to the sitemap. WordPress sites typically disallow /wp-admin/ and allow everything else. Shopify and most builders generate one automatically. The key point is that it should exist and be correct — and you can check yours right now by opening yourdomain.co.uk/robots.txt in a browser. If you see a sensible few lines, you are fine. If you see nothing, or a page error, your site has no robots.txt, which is usually harmless but worth fixing. If you see “Disallow: /” on its own, your entire site is telling Google to stay away — and that needs fixing today.

The mistake that hides websites

The classic disaster goes like this: a developer blocks Google while building a new site (sensible — you do not want an unfinished site indexed), and then forgets to remove the block at launch. The site goes live, looks perfect, and gets no visitors from Google — ever. Months pass before anyone checks. The fix is one line, but the lost rankings take months to rebuild. Every launch checklist should include checking robots.txt, and every redesign should too. It is a thirty-second check that has saved more businesses than any other single habit. Google Search Console will also warn you if it finds your site blocked, but only if someone is looking at Search Console.

What robots.txt cannot do

Robots.txt cannot keep a page out of Google’s results on its own: if other sites link to a blocked page, Google may still list its address without its content. To genuinely remove a page from search results, use a “noindex” instruction on the page itself, not robots.txt. And robots.txt cannot protect private information — never rely on it to hide anything sensitive. If a page should not be seen, protect it with a login, not a text file. Our technical SEO checks include robots.txt as standard, because it is small, it is important, and it is exactly the kind of thing that gets forgotten. If you would like us to check yours, send us your web address — it takes a minute, and it might be the most valuable minute your website ever gets.

Checking robots.txt in Search Console

Google Search Console has a robots.txt tester that shows exactly how Google reads your file and whether any important page is blocked. It takes a minute to use: paste the address of a page you want Google to find, and the tester tells you whether robots.txt allows it. Use it after any change to the file, and after any redesign or migration. The tester also shows the file as Google sees it, which is useful if you suspect caching — a file you changed yesterday may not be the file Google is reading today. If the tester shows a block you did not intend, fix the file and ask Google to re-check; the change usually takes effect within a day or two.