freecourses.digital
Lesson progress: 0 of 3 activities done
All lessons in Technical SEO Auditing Lesson 4.2 of 84

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. /search blocks /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

  1. File status: robots.txt returns 200 (or 404). A 5xx is urgent.
  2. No sitewide block: no Disallow: / for Googlebot or *.
  3. Important sections allowed: products, services, blog, locations.
  4. Resources allowed: CSS, JavaScript, images, fonts.
  5. Low-value areas blocked on purpose: carts, checkout, internal search, endless filters.
  6. Sitemap lines point to live sitemaps on the right host.
  7. 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/

  • /wp-content/themes/ (CSS and JS)

  • Internal search results /search?q=

  • /products/

  • Endless sort parameters /*?sort=

  • /blog/

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: /p blocks /products/ too.
1. What does Disallow: /p block?
2. Why should CSS and JS stay crawlable?
3. Robots.txt returns 503 for days. What may happen?

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.