Customers & growth · SEO & search marketing
Robots.txt optimization
Best for Growth
Use it when
You need to write or fix your robots.txt file so crawlers skip wasted URLs while every page and file Google needs stays open.
Skip it when
- Key pages are missing from Google and you do not yet know why. Run Crawlability & indexation framework first, which this card builds on.
- Several URLs show the same content and you need one version indexed. Use Canonical URL management, which this feeds.
- You need to design, submit and monitor the sitemap set itself. Use XML sitemap strategy.
- The site has many thousands of URLs and you need to see exactly what Googlebot requests. Use Log file analysis framework.
What to apply first and what to use instead are listed below.
Inputs
- Live robots.txt filesThe current file for every host, subdomain and protocol the site serves, fetched today with its status code.
- Wasted crawl patternsURL patterns crawlers should skip, such as endless filter, sort and internal search URLs, from the Crawlability & indexation framework fix list or crawl stats for the last 90 days.
- Key URLs and resourcesPages that must be crawled, plus the CSS, JavaScript and image files their templates load, from the CMS and a site crawl run this week.
- Sitemap URLsThe full address of every XML sitemap or sitemap index.
- Crawler listThe user agent tokens you will address, such as Googlebot, Googlebot-Image or Google-Extended, from each search engine's crawler documentation.
- Server logsOptionalRequests per user agent and URL pattern for the last 30 days, from the hosting provider.
Steps
- Fetch the file at the root of each host and check it returns 200, is plain UTF-8 text, stays under 500 KiB and covers only that protocol, host and port.
- List each URL pattern to block with its reason, and remove from the list any page you want out of search results, since those need noindex or removal.
- Write the groups, one per user agent, with Disallow and Allow paths using * and $ where needed, repeat shared rules inside each specific group, and add a Sitemap line with the full URL of each sitemap.
- Test the draft with Google's open-source parser or the robots.txt report, and check every key URL and one sample URL per blocked pattern with URL Inspection.
- Publish the file at the root, request a recrawl in the robots.txt report, and log each rule with its reason and the publish date.
- Recheck crawl stats and the page indexing report a few weeks later for key pages marked blocked by robots.txt or indexed though blocked.
Output
One robots.txt file per host and a rule log that says why each rule exists and how it was tested.
- Host and file URL
- User agent group
- Rule (Allow or Disallow and its path pattern)
- URL pattern targeted and the reason
- Sample URLs tested and result
- Date published and recrawl requested
Done when
- Every host returns its robots.txt with a 200 status at the root.
- The robots.txt report shows the file fetched with no errors.
- Every key URL tests as allowed in URL Inspection.
- No rule blocks a CSS, JavaScript or image file that a key template loads.
- Every rule in the file has a reason in the log, and every Sitemap line is a full URL.
Measure
Over the four weeks after publishing, track crawl requests by response and file type in crawl stats, indexed counts for key pages, and pages marked blocked by robots.txt in the page indexing report. Compare them with the four weeks before. It worked when requests to blocked patterns fall while crawling and indexing of key pages hold or rise.
Hypothetical example
Brightfold, an online furniture store, finds in crawl stats that most Googlebot requests hit sort and color filter URLs such as /sofas?sort=price&color=grey. Its robots.txt has a Googlebot group that only blocks /checkout/, so Googlebot ignores the wider rules in the * group. The team writes one * group and one Googlebot group, each blocking /*?sort= and /*?color= plus /search/ and /checkout/, and adds the sitemap index URL. URL Inspection shows all 40 key category pages allowed and a sample filter URL blocked. Four weeks later, requests to filter URLs have dropped and new product pages are crawled within days.
Common mistakes
- Disallowing pages to get them out of search results. Blocked URLs can still be indexed from links, so use noindex and let the page be crawled, or remove it.
- Blocking CSS, JavaScript or image folders. Leave open every file a page needs so Google can render it.
- Adding a group for one crawler without the shared rules. A crawler follows only its most specific group, so repeat the rules it needs there.
- Treating the file as security for private paths. The file is public and voluntary, so protect those paths with a login.
- Relying on crawl-delay or noindex lines, which Google ignores. Manage crawl load and indexing with tools that Google supports.
Sources
- RFC 9309: Robots Exclusion Protocol · Martijn Koster, Gary Illyes, Henner Zeller, Lizzi Sassman, 2022
- How Google interprets the robots.txt specification · Google Search Central, 2026
- Create and submit a robots.txt file · Google Search Central, 2026
Show all 6 sources
- Robots.txt introduction and guide · Google Search Central, 2026
- robots.txt report · Search Console Help, 2026
- Google's common crawlers · Google Search Central, 2026
By company stage
Apply first
- Crawlability & indexation frameworkCustomers & growth · SEO & search marketing
Robots.txt controls crawling (not indexing); confusing the two is a common error that crawl basics prevent.
Use instead
- Crawlability & indexation framework
Key pages are missing from Google and you do not yet know why. Run Crawlability & indexation framework first, which this card builds on.
- Canonical URL management
Several URLs show the same content and you need one version indexed. Use Canonical URL management, which this feeds.
- XML sitemap strategy
You need to design, submit and monitor the sitemap set itself. Use XML sitemap strategy.
- Log file analysis framework
The site has many thousands of URLs and you need to see exactly what Googlebot requests. Use Log file analysis framework.
Where it sits
Open the seo & search marketing roadmapRecommended resources
No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.
Progress is not saved until you have an account. Create a free account