Melbourne-based

Rank in the map pack

City and suburb pages built to win local search across Australia.

Free local audit
Technical SEO · Guide

Robots.txt Explained: What to Block and What to Leave Alone

Andy Merritt, founder of SEO Soar
Andy MerrittFounder, SEO Soar · 6 min read
Robot at a gate in front of a website, some paths lit and some dimmed

Robots.txt is a plain text file that sits at the root of your website and tells crawlers which parts of the site they may fetch. It is one of the oldest conventions on the web, it is read by everything from Googlebot to the AI crawlers training the latest chatbots, and it is also one of the easiest ways to accidentally wreck your own rankings. One wrong line in robots.txt can remove an entire site from Google. This guide explains how the file works, what is worth blocking, what to leave alone, and the mistakes we keep finding on real audits.

What robots.txt actually does

When a well-behaved crawler visits your site, the first thing it requests is yoursite.com/robots.txt. The file contains crawl directives: simple rules saying which user agents (crawlers) may fetch which paths. A typical robots.txt file looks like this: a User-agent line naming the bot, then Disallow and Allow lines listing paths, and usually a Sitemap line pointing to your XML sitemap.

Here is a complete, sensible robots.txt for a typical WordPress business site: a User-agent: * line applying the rules to everyone, Disallow: /wp-admin/ with Allow: /wp-admin/admin-ajax.php, and a Sitemap: line. Three rules, and for many sites that is genuinely all it should say.

Two things matter about the mechanism. First, it controls crawling, not indexing; that distinction does a lot of work later in this guide. Second, the rules are voluntary. Reputable crawlers follow them, but nothing forces compliance. It is a "please keep off the grass" sign, not a fence, which is why our plain-English guide to technical SEO files it under communication with search engines rather than security.

What's worth blocking

For most business sites, the honest answer is: very little. Good candidates for a disallow rule are pages that waste crawl attention without ever deserving a ranking. Internal search results pages, which can generate infinite URL variations. Cart, checkout and account areas of a store. Filtered and sorted duplicates of category pages. Staging or testing paths that accidentally became reachable. And admin areas, though your CMS usually protects those anyway.

Robot reading a scroll of rules at a fork between two paths

The common thread: block pages that are genuinely useless to searchers and exist in unbounded quantities. On large sites this protects your crawl budget, the attention Google is willing to spend on you. On a twenty-page tradie site, crawl budget is a non-issue, and the best file is usually the shortest one.

What to leave alone

Never block CSS and JavaScript files. Google renders pages like a browser, and if the file hides your styling and scripts, Google sees a broken page and judges you on it. Do not block pages you want ranked, obviously, but also be careful with sweeping folder rules that catch them by accident; a single Disallow: / removes everything. And do not use crawl directives to hide thin or duplicate pages that are already indexed; blocking them just freezes them in the index as-is, because Google can no longer crawl the page to see your noindex tag.

The rule of thumb: robots.txt answers "may you fetch this URL?", nothing more. If the question you are really asking is "should this appear in Google?", the answer belongs in a noindex tag, not here.

Robots.txt and AI crawlers

The file has a new job in 2026: it is where you decide how AI systems access your content. OpenAI's GPTBot, Anthropic's ClaudeBot, Google-Extended and PerplexityBot all identify themselves and respect its directives, so you can allow or refuse them per bot. Some publishers block them to keep their content out of training data. For most businesses, we recommend the opposite: AI assistants are now a discovery channel, and being readable is a precondition for being cited in AI answers. Whichever way you lean, make the choice deliberately: check your file today and see whether a developer or plugin has already made it for you, because some security and CDN tools now block AI crawlers by default. There is also a newer companion file designed specifically for AI systems; our guide to llms.txt covers what it is and whether it is worth adding alongside it.

Robots.txt is not security

This deserves its own section because it is the most dangerous misunderstanding of all. Robots.txt is a public file; anyone can read yours right now by typing the URL. Listing a "secret" folder in it does not hide the folder, it advertises the folder, and malicious bots ignore the file entirely. Worse, a blocked URL can still end up in Google: if other sites link to it, Google may index the bare address without crawling it. Google's own documentation is explicit that robots.txt is not a mechanism for keeping pages out of search results. Anything genuinely private belongs behind a password, and anything you want de-indexed needs a noindex tag or removal, not a crawl directive.

Gate with an open lane and a closed lane, crawler bots queued in front

Common mistakes, and how to check yours

The failures we find on audits are rarely exotic. A developer launches a redesign with the staging site's Disallow: / still in place, and rankings evaporate over the following weeks. A folder rule written for one section quietly catches another, because rules match by prefix and a missing trailing slash widens the net. Or the file blocks a page that carries a noindex tag, so the noindex is never seen and the page lingers in results anyway. Every one of these ships silently; nothing warns you at the moment the damage is done.

Checking takes five minutes. Load yoursite.com/robots.txt and read every disallow line, asking "do I actually want this hidden from crawlers?". Then open the Pages report in Google Search Console, which flags URLs that are "blocked by robots.txt" or "indexed, though blocked". We run this exact check inside our technical SEO checklist, and it is a standard part of our technical SEO service. If anything in your file looks wrong and you are not sure why, ask us before you edit; five minutes of review beats a month of lost traffic.

Andy Merritt, founder of SEO Soar
Andy MerrittFounder of SEO Soar. Senior SEO specialist, Melbourne. I work on every campaign directly, no juniors, no runaround.
Questions

Quick answers

Does robots.txt stop a page appearing in Google? +

Not reliably. Robots.txt stops Google crawling a page, but if other sites link to that URL, Google can still index it without visiting, showing a bare listing with no description. To keep a page out of search results, let it be crawled and use a noindex tag, or protect it behind a login.

Should I block AI crawlers in robots.txt? +

For most businesses, no. Blocking bots like GPTBot or ClaudeBot keeps your content out of the AI tools your customers now use to research and buy, which is visibility most businesses want, not something to prevent. Blocking makes sense mainly for publishers whose content is the product being resold.

What happens if I don't have a robots.txt file? +

Nothing bad. When a crawler requests the file and gets a 404, it assumes it is allowed to crawl everything, which is the right default for most small sites. A missing file is far safer than a misconfigured one; a single wrong disallow line can remove a whole site from search.

Free, no obligation

Is your site accidentally blocking Google?

Run the free audit and we'll check your crawl setup, indexing and technical health, and show you exactly what's worth fixing first.

Get my free SEO audit📞
SEO ServicesIndustriesLocationsResultsResourcesAboutContact Free SEO audit