Robots.txt Audit
In this lesson
- How robots.txt rules are written and matched
- What to check during a robots.txt audit
- How to find important pages and resources that are blocked
- How to test changes before publishing
Short answer
A robots.txt audit checks that the file at your domain root allows crawling of important pages, CSS, and JavaScript, while blocking only low-value areas like carts and internal search. Read each rule, list blocked URLs from your crawl, test them in Search Console's robots.txt report, and confirm sitemap lines point to live sitemaps.
One line can hide a whole website: Disallow: /. It is the default on many staging sites, and it sometimes survives launch day. That is why robots.txt is one of the first files every auditor opens.
Reading the file
User-agent: *
Disallow: /cart/
Disallow: /search
Disallow: /*?sort=
Allow: /wp-admin/admin-ajax.php
Disallow: /wp-admin/
Sitemap: https://www.example.ph/sitemap_index.xml
- Rules are grouped by User-agent.
- Paths match from the start of the URL.
/searchblocks/search,/search/, and/searchresults. *matches anything,$marks the end.- Google follows the most specific matching rule, so Allow can open a path inside a Disallow.
The audit checklist
- File status: robots.txt returns 200 (or 404). A 5xx is urgent.
- No sitewide block: no
Disallow: /for Googlebot or*. - Important sections allowed: products, services, blog, locations.
- Resources allowed: CSS, JavaScript, images, fonts.
- Low-value areas blocked on purpose: carts, checkout, internal search, endless filters.
- Sitemap lines point to live sitemaps on the right host.
- Every host checked: www, non-www, subdomains, staging.
Finding blocked URLs
Run your crawl with “respect robots.txt” on, then open the Blocked by Robots.txt filter. For each, the crawler shows the matching rule. Compare with Search Console’s robots.txt report and the “Blocked by robots.txt” reason in the Pages report.
Practice: should this be blocked?
Sort each item into the right group.
-
/checkout/
Answer: Fine to block.
-
/wp-content/themes/ (CSS and JS)
Answer: Should be allowed.
-
Internal search results /search?q=
Answer: Fine to block.
-
/products/
Answer: Should be allowed.
-
Endless sort parameters /*?sort=
Answer: Fine to block.
-
/blog/
Answer: Should be allowed.
Common mistakes
- Staging Disallow: / pushed live.
- Blocking CSS or JS folders. Pages render broken for Google.
- Using robots.txt to hide pages from results. Use noindex instead (Lesson 4.3).
- Overly broad patterns.
Disallow: /pblocks /products/ too.
Your action
Next, you will audit meta robots tags and X-Robots-Tag headers.
Key terms
- User-agent
- The line naming which crawler a group of rules applies to, such as * for all or Googlebot.
- Disallow
- A rule telling crawlers not to fetch URLs that start with or match a path.
- Allow
- A rule that permits a path inside a broader Disallow. Google uses the most specific matching rule.
- Wildcard
- The * symbol matching any characters, and $ marking the end of a URL, used in patterns like /*?sort=
Questions beginners ask
Where is robots.txt located?
Always at the root of each host, like https://www.example.ph/robots.txt. Each subdomain and protocol needs its own file.
Should I block CSS and JavaScript?
No. Google needs them to render pages. Blocking them can make pages look broken or empty to Googlebot.
What happens if robots.txt returns 5xx?
Google may pause crawling the whole site until it can read the file. A 404 robots.txt is treated as no rules, meaning everything is allowed.
Should I block AI crawlers in robots.txt?
That is a business choice. Check which user agents are listed and confirm the decision is intentional, not copied from a template.
Related lessons
Want someone to handle SEO for your business while you learn? The team at Remar Digital can help.