Robots.txt is the smallest file on your site and one of the most dangerous. It is a plain-text file, usually under a kilobyte, at the root of your domain — and a single wrong line can hide your entire site from Google. A stray Disallow: / copied over from staging stops all crawling; a rule blocking CSS and JavaScript stops Google rendering your pages; a forgotten block on a section quietly starves it of traffic for months. A robots.txt audit reads the file the way Googlebot does, tests every rule against real URLs, and catches those accidents before they cost you rankings.
What robots.txt does — and what it does not do
Robots.txt is a set of instructions for crawlers, written in the Robots Exclusion Protocol, standardised as RFC 9309. A crawler fetches /robots.txt first and follows the rules for its user-agent before requesting any page. Google supports four fields — User-agent, Disallow, Allow and Sitemap — and ignores anything else. Two facts trip people up. First, it controls crawling, not indexing: blocking a page stops Google reading it, but the URL can still appear in search results if other sites link to it, usually with no description. Second, it is a request, not a lock: well-behaved crawlers obey it, but nothing enforces it, so it is not a security tool. Never use robots.txt to hide anything sensitive — if a URL must stay private, protect it with a login.
Step 1: fetch the file the way a crawler does
Start by fetching the live file yourself. Open https://yoursite.com/robots.txt in a browser and read what is actually there, not what you remember writing. Then check it as a crawler sees it: curl -I https://yoursite.com/robots.txt should return a plain 200 with a text/plain content type. A 404 means there is no file, which Google treats as "no restrictions" — every crawler may fetch everything. A file that redirects to an HTML page is not a robots.txt file at all. And a 500 error is the dangerous one: on a server error Google stops crawling the site for the first 12 hours while it retries, then falls back to the last good copy for up to 30 days. Fetch the file on every host you run — www and non-www, staging and production — because one file covers one host only. Google reads only the first 500 KiB of the file and ignores the rest, and it generally caches the file for up to 24 hours, so a fix you deploy now is not read at once.
Step 2: read the rules — the audit checklist
With the live file in front of you, work through the checks below. Most audits find their problem in the first three.
1. The accidental site-wide block
Look for Disallow: / under User-agent: *. That one line blocks every crawler from every path, and it is the most common catastrophic robots.txt error. It almost always arrives by accident: a staging file copied to production, or a developer who meant to block one folder and typed the root instead. If your site has one, remove it now — every day it sits there, Google cannot crawl anything new, and pages drop out of the index as they are re-checked.
2. Blocked CSS and JavaScript
Google renders pages before ranking them, and rendering needs your CSS and JavaScript. Rules like Disallow: /wp-content/, Disallow: /assets/ or Disallow: /*.js$ can block the very files Google needs to see the page as a visitor sees it. A page Google cannot render may be ranked on its raw HTML alone — missing content, layout and quality signals. Allow the resource folders explicitly, and check a rendered page in URL Inspection to confirm Google sees the finished page.
3. Staging leftovers and the noindex trap
Blocking staging is correct — the failure is when that file, or a rule like Disallow: /staging/, survives the move to production. Search the file for every path that only existed before launch. The subtler version is the noindex trap: a page carries a noindex tag, but robots.txt also blocks it. Google cannot crawl a blocked page, so it never sees the noindex — and the URL can linger in search results indefinitely. The rule is simple: a page is either blocked from crawling or tagged noindex, never both. If a page should not be indexed, let Google crawl it and read the noindex.
4. The sitemap directive
Your robots.txt should point crawlers at your sitemap with a Sitemap: line giving the full URL, for example Sitemap: https://yoursite.com/sitemap.xml. It is a hint, not a submission — Google still needs the sitemap submitted in Search Console — but it is the discovery path for every other crawler, and it costs one line. Check the URL is absolute, uses the live domain, and returns 200. A sitemap directive pointing at a 404 or at the old domain after a migration quietly wastes the file's best feature. Our XML sitemap audit covers the file that directive points to.
5. Wildcard mistakes
Google supports two wildcards in robots.txt paths: * matches any sequence of characters and $ marks the end of a URL. They are powerful and easy to get wrong. Disallow: /*? blocks every URL with a query string — your faceted navigation, but also campaign-tagged landing pages. Disallow: /*.pdf$ blocks only URLs ending in .pdf; without the $, Disallow: /*.pdf also blocks /guide.pdf?download=1 and any path that merely contains ".pdf". Test every wildcard rule against a real URL from each pattern it should and should not match.
6. The wrong user-agent group
Google applies the most specific user-agent group that matches the crawler. A rule under User-agent: * applies to every crawler, including Googlebot — unless a User-agent: Googlebot group also exists, in which case Googlebot follows only its own group and ignores the * group entirely. That is how a site ends up blocking Googlebot while allowing everyone else: someone adds a Googlebot-specific group to allow one path and forgets it also needs the general rules. Read each group as a self-contained file for that crawler, and check the groups that matter: Googlebot, Bingbot, and AI crawlers such as GPTBot and ClaudeBot.
7. Crawl-delay and other myths
Crawl-delay is the most persistent robots.txt myth. Google does not support it and ignores the line entirely, and Google retired the crawl-rate limiter in Search Console on 8 January 2024. Bing does support crawl-delay — but if you added it to slow Googlebot, it is doing nothing. The same goes for noindex inside robots.txt: Google dropped support for it years ago, so a Noindex: line in the file is dead text. Either line in your file means it was written from an old guide, and the rest deserves a second read.
8. File errors: location, case, encoding
The file must be named exactly robots.txt, in UTF-8 plain text, at the root of the host. Paths in it are case-sensitive: Disallow: /Admin/ does not block /admin/. Comments start with #. A file saved with a byte-order mark, served as HTML, or wrapped in markup by a plugin is not a robots.txt file at all — Google reports a parsing error and ignores what it cannot read.
Step 3: test every rule against real URLs
Reading the file is half the audit; testing it is the other half. Google retired the Search Console robots.txt Tester in late 2023, so the old paste-a-path workflow no longer exists. Three things replaced it. First, the robots.txt report in Search Console, under Settings, shows which files Google fetched, when, and any fetch or parsing problems — and lets you request a recrawl after a fix. It is available only for domain-level properties, and it tells you what Google is reading, not whether a given URL is blocked. Second, the URL Inspection tool tests a single live URL and reports whether robots.txt blocked the crawl. Third, for drafts, test before you deploy: paste the file into an external robots.txt checker, or run Google's open-source robots.txt parser locally. Test the URLs that matter — your homepage, a money page, a path you meant to block, a resource file — and confirm each one gets the verdict you expect. Then check Search Console's Pages report: "Blocked by robots.txt" should list only URLs you meant to block, and "Indexed, though blocked by robots.txt" should be empty — every URL there is a page Google wants to show but cannot read.
Worked example: the good file and the bad file
A good file for a small site reads in ten seconds:
User-agent: *
Disallow: /wp-admin/
Disallow: /search/
Allow: /wp-content/uploads/
Sitemap: https://yoursite.com/sitemap.xml
Every line earns its place: admin and internal search stay uncrawled, uploads stay reachable so images render, and the sitemap is declared. Now the bad version of the same file, assembled from real mistakes:
User-agent: *
Disallow: /
Disallow: /wp-content/
Crawl-delay: 10
Noindex: /old-page/
Sitemap: https://old-domain.com/sitemap.xml
Five errors in six lines. The first line blocks the whole site. The second blocks the CSS, JavaScript and images Google needs to render pages. Crawl-delay does nothing for Google. The Noindex line is dead text Google stopped supporting years ago. And the sitemap points at a domain the site no longer uses. A site running this file would be invisible to Google and unrenderable — all from a file most teams never open. The audit that finds it takes five minutes: fetch the file, read it, test a URL.
Keeping robots.txt honest after the audit
A robots.txt file rots at the speed the site changes, and the most common way it breaks is a deploy that overwrites it silently — a CMS update, a plugin install, a staging push. Treat the file as part of the build: read it after every change that could touch it — plugin updates, theme changes, migrations. On a stable site, a quick monthly check — fetch the file, confirm it is unchanged, glance at the robots.txt report — is enough, with a full audit quarterly or after any traffic drop you cannot explain. Two habits help between audits: keep the file short, with a comment above any rule that is not obvious, and never edit it by hand on the server — edit the source, deploy it, then fetch the live URL and confirm the deployed copy is the one you wrote. The file is too small to deserve a process and too powerful to go without one. If the audit turned up problems elsewhere — pages missing from the sitemap, orphan pages, thin content — our technical SEO audit and internal linking audit cover the next steps. And try the free robots.txt tester tool or the free SEO audit tool to check your own site in one pass.
Frequently asked questions
What is a robots.txt audit?
It is a check of the robots.txt file the way a crawler reads it: that the file exists at the domain root, returns a 200 status, is valid plain text, and that every rule does what you think it does. The audit tests each Disallow and Allow against real URLs, checks that CSS and JavaScript are reachable, confirms the sitemap directive, and looks for leftovers from staging or redesigns.
Can robots.txt stop a page from ranking?
Not directly — robots.txt controls crawling, not indexing. A page blocked by robots.txt cannot be crawled, but Google can still show its URL in search results if other pages link to it; it usually appears without a description, because Google has never read the page. To keep a page out of search results, use a noindex tag instead — and make sure robots.txt does not block the page, or Google can never see the noindex.
How do I test a URL against my robots.txt now that the tester is retired?
Google retired the Search Console robots.txt Tester in late 2023. Its replacement, the robots.txt report under Settings, shows which files Google fetched, when, and any parsing problems — but it does not test a single URL. For one live URL, use the URL Inspection tool, which reports whether robots.txt blocked the crawl. For drafts, test locally with an external robots.txt checker or Google's open-source robots.txt parser before you deploy.
What does Disallow: / do, and how do I spot it?
Disallow: / under User-agent: * blocks every crawler from every path on the site — the whole site stops being crawled. It is the single most damaging line in robots.txt, and it usually arrives by accident: a staging file copied to production, a plugin update, or a developer who meant to block one folder. Spot it by fetching the live file and reading it, and by watching Search Console's Pages report for a sudden rise in "Blocked by robots.txt".
Should I use crawl-delay to slow Googlebot down?
No — Google does not support crawl-delay and ignores the line entirely. Google also retired the crawl-rate limiter in Search Console on 8 January 2024. If Googlebot is genuinely overloading your server, Google's own advice is to return a 500, 503 or 429 status for a day or two at most, not to add a directive crawlers will ignore. Bing does support crawl-delay, so the line is not useless everywhere — but it does nothing for Google.
How often should I audit robots.txt?
Read the file after every deploy that could touch it: a redesign, a migration, a CMS or plugin update, or a staging-to-production push. On a stable site, a quick monthly check — fetch the file, confirm it is unchanged, glance at the Search Console robots.txt report — is enough, with a full rule-by-rule audit quarterly or after any traffic drop you cannot explain. A robots.txt file is small enough to check in a minute and dangerous enough to deserve the minute.
Run this on your own site — free
The checks above take an afternoon by hand. Our free audit tool runs the technical, speed and on-page checks for you in about a minute.
Run the free SEO audit