What does robots.txt control, and what doesn't it?
Robots.txt asks well-behaved crawlers to stay away from certain addresses. It locks nothing, and it removes nothing from Google.
Anyone can open the file at /robots.txt, and anyone can ignore it. Even the standard says its rules are not a form of access authorization. So a Disallow: /secret-launch/ mainly tells the curious where to look. A page that has to stay private needs a password.
A blocked page can also still appear in Google. Google can't read it, but when other sites link to it, Google may list the address anyway, and then the result has no description. Search Console calls that "Indexed, though blocked by robots.txt", one of the statuses in the Page indexing report.
I see this at scale on a shop that sells printed promotional products. Thousands of its blocked addresses show up in Google's results: about a third of all its impressions, for almost no clicks. That shop's whole story is on the crawler traps page.
The same block breaks noindex. A page that robots.txt blocks is never fetched, so Google never sees the noindex on it. For noindex to work, the page must not be blocked by a robots.txt file. When a page has to go, let Google crawl it with the noindex until it has dropped out of the results. Blocking it after that is up to you.
Robots.txt is about crawling, not about the index. I use it to keep Google out of the cart, the internal search and the filters, so it spends its time on the pages that sell. Anything that has to disappear from Google gets a noindex, not a Disallow.
How do you write a robots.txt file?
A robots.txt file is a short list of groups. Each group names one or more crawlers and says which paths they may not fetch (Disallow) or may fetch after all (Allow). One Sitemap line tells every crawler where your list of pages is.
Each file lives at the root of a host, like https://www.example.com/robots.txt. Every host and protocol reads its own file, so https://www., https:// without www and a subdomain such as shop. each need one. A copy in a subfolder does nothing.
User-agent starts a group and says who it's for; * means every crawler that has no group of its own. Disallow takes the start of a path, and Allow makes an exception inside it. In a path, * stands for any run of characters and $ for the end of the address. Paths are case-sensitive, each rule gets its own line, and # starts a comment. A Sitemap line takes a full URL and stands outside the groups, so every crawler reads it.
A shop's file can be as short as this:
# Keep crawlers out of pages that have no business in Google
User-agent: *
Disallow: /cart/
Disallow: /checkout/
Disallow: /account/
Disallow: /search?
Disallow: /*?*sort=
Disallow: /*?*filter=
Sitemap: https://www.example.com/sitemap.xml
Read it the way a crawler does. The cart, checkout and account pages stay out, and so do internal search results and every sorted or filtered list. Products and categories are open because no rule mentions them, and the last line points to the sitemap.
Most sites never write one from scratch. When there's no file on disk, WordPress serves a virtual one that blocks /wp-admin/ and allows /wp-admin/admin-ajax.php. Shopify writes a longer default that keeps crawlers out of the cart, the checkout, the account pages and sorted or filtered collections. Both are fine as they are. Trouble starts with the lines a theme, a plugin or an agency adds on top.
Why does Google ignore some of your robots.txt rules?
Google reads the file by its own rules: it obeys one group, picks the longest matching rule and drops the lines it doesn't support. So a file can look right to you and do something else for Googlebot.
The one-group rule is the one you can't see by reading the file. Google picks one group per crawler, the one with the most specific user agent that matches, and ignores the others. The moment a file has a User-agent: Googlebot group, Googlebot skips every rule under *. On 1 December 2026 I read the robots.txt files of every live site I have access to, the way Googlebot reads them: 179 files on 199 sites. Seven have a Googlebot group that leaves out rules of the * group. On a holiday-rental site, the blocks for /booking and for the page numbers never reach Googlebot.
User-agent: *
Disallow: /cart/
Disallow: /*?*sort=
User-agent: Googlebot
Disallow: /admin/
Here Googlebot reads only the second group, so it may crawl the cart and every sorted list. Repeat the * rules in the Googlebot group, or delete that group if it adds nothing.
Within a group, the longest matching rule wins, and on a tie Google takes the least restrictive one, the Allow. Disallow: /shop/ with Allow: /shop/sale/ lets /shop/sale/shoes through. Case counts too: Disallow: /Checkout/ leaves /checkout/ wide open.
Google reads four fields: user-agent, allow, disallow and sitemap. Crawl-delay, host and anything else are skipped, and a noindex line in robots.txt stopped working on 1 September 2019. In 42 of the 179 files there's a line Google ignores, mostly a crawl-delay (24 files). A crawl-delay doesn't slow Googlebot down at all.
Broken lines are rare. Five files have one, such as a line without a colon or an error message a translation plugin wrote into the file. Google skips such a line and reads the rest. Syntax is where most people look first, and in these files it was the smallest problem.
Should you block CSS and JavaScript in robots.txt?
No. Leave every stylesheet and script a page loads open to Googlebot. It doesn't even request a file that robots.txt blocks, and Google won't render JavaScript from blocked files.
For each of the 179 files, I tested every CSS and JavaScript file the homepage loads against the group Googlebot obeys. Twelve block CSS or JavaScript the homepage loads. On four, it's the main stylesheet or the core script.
The clearest case is a packaging webshop on a Magento template that gets copied around a lot. Its robots.txt has two lines, Disallow: /*.js$ and Disallow: /*.css$, and together they block all 40 stylesheets and scripts its homepage loads. I loaded that homepage in a phone-sized browser without them. It came out 1,430 pixels wide on a 412-pixel screen, with no styling at all: the logo, the bullet lists and the whole menu as one long column of plain blue links. That's the page Google gets.

A demo shop built for this article, rendered with and without its CSS and JavaScript.
Google looks at a page the way a visitor does, with the CSS and the scripts. Block those in robots.txt and Google gets the page without them. Nobody does that on purpose. It comes with a template or from the host, and after that nobody looks at the file again.
Five of the twelve came from just two templates. One is that Magento file. The other is one web agency's standard WordPress file, on four sites, which blocks /wp-includes/: the folder where WordPress keeps its own scripts, jQuery among them.
It doesn't always show. I rendered seven of these homepages, and on three nothing visible changed, because the blocked file was a date picker, a lightbox or a small widget. So don't guess from the file. Run the page through the live test in URL Inspection (step 3 below) and look at the screenshot Google made.
The fix is to delete the lines that block .css and .js files, or the folders they live in. On WordPress, never block /wp-includes/, and leave /wp-content/ open too, since themes and plugins keep their files there. I wouldn't patch it with an Allow: line per file. Every theme update or new plugin can bring a new folder, and the patch is out of date before anyone notices.
What should a robots.txt block on a shop or business site?
Block what has no business in Google and only eats crawling. Next to the cart, the search and the filters from above, that's the checkout and the account pages: nobody searches for them, and on a big shop the crawling is better spent on products. Never block a page you want out of the index, and never a file a page needs.
Filters, sort orders and other parameters get their own page, crawler traps, with a table of when to use robots.txt, noindex, a canonical or nofollow.
Two mistakes are easy to miss. The first is a sitemap that lists addresses the same file blocks. Seven of the 179 files I read do this, among them thank-you and terms pages that are both in the sitemap and under Disallow. One file says stay out, the other says come in. Take the address out of one of the two.
The second is a rule that catches more than you meant. Disallow matches the start of a path, so a Disallow: */feed on one of those sites also blocks its /feedback/ pages. End a rule with a slash or a $ when you mean that one folder or that one address, as the example file above does.
And add the Sitemap line if it's missing: 18% of the files I read have none, and it costs one line.
Whether to block AI crawlers is a choice per bot. The search bots behind ChatGPT search and Perplexity are the ones a shop wants in, and AI crawlers lists them with what each one does.
How do you check a robots.txt, for one site and for every client?
- Open
/robots.txton every host the site uses: with and without www, and every subdomain that serves pages. - Find the group Googlebot reads and read only that one. It's the group that names Googlebot if the file has one, otherwise the
*group. Then look at what that group blocks. - Put the pages that matter into Search Console's URL Inspection: the homepage, a category, a product. Run the live test. "Crawl allowed?" says whether a robots.txt rule blocks the page, and "View tested page" shows the screenshot Google rendered and the resources it loaded. A screenshot that looks like the unstyled phone above means files are blocked.
- Look again after every launch, migration, new theme, plugin or host. That's when a template writes the lines from the CSS section into the file. Google caches robots.txt for up to 24 hours, so a fix can take a day to count.
- Open the robots.txt report in Search Console, under Settings. It lists the robots.txt files Google found for the property, when it last checked each one, whether the fetch worked, its size and any issues. After a fix, choose "Request a recrawl" in the file's menu. The report only works in a Domain property or a URL-prefix property without a path.

Demo account, sample data.
Most mistakes in robots.txt aren't typos. They're rules that do exactly what they say, just not what you meant. So I read the file the way Googlebot does: which group is mine, and what does that group block.
For one site, that's the whole check. Across a list of client sites, the reading stays manual. MarketingTracer's SEO audit does check two basics on each one: at the top of its Issues tab, under "The site itself", it shows whether robots.txt exists and whether it names the sitemap. When a page isn't indexable, the audit gives the reason, and one of them is "robots.txt blocks this address". So a Disallow that keeps out a page you care about turns up in that site's audit. It sees the pages that links and the sitemap lead to. Whether a Googlebot group skips your * rules and whether the CSS or scripts are blocked, it doesn't flag: those stay steps 2 and 3.

Demo account, sample data.
What happens when robots.txt is missing or returns an error?
A missing robots.txt is harmless. One that returns an error can stop Google from crawling the whole site.
When the file answers with a 404 or another 4xx code, 429 aside, Google acts as if there's no robots.txt and crawls everything. That's a perfectly good setup: 8 of the 199 sites I checked have no file at all. A redirect works too. Google follows at least five hops and treats the file as missing after that.
A server error is the one to worry about. When robots.txt answers with a 5xx or a 429, or times out, Google stops crawling the site for 12 hours and keeps trying. For the next 30 days it uses the last good copy of the file; after that, it depends on whether the rest of the site is up. So a robots.txt that errors is worse than none.
A firewall can cause the same stop. If bot protection answers Googlebot's robots.txt request with a 429 or a 5xx, the crawl halts as if the server were down. A 403 counts as no file at all.