Skip to main content

Disallow Directive Test

What is it?

Disallow directives in a site's robots.txt file tell search engine crawlers not to access specific files, paths, or directories, which is useful for keeping admin sections and low-value URLs out of indexes but dangerous when applied too broadly. A single stray Disallow: / blocks every URL on the site from being crawled, and the symptoms can take days or weeks to surface. This test surfaces the disallow rules declared in your site's robots.txt so you can confirm that critical content is not being blocked by mistake.

Why disallow rules matter

Robots.txt is one of the few configuration files that can break SEO instantly and silently. A single stray Disallow: / blocks every URL on the site from being crawled, and because Google does not always immediately surface the issue in Search Console, the symptoms (gradually disappearing rankings, no crawl activity in server logs) can take days or weeks to become obvious. Auditing the disallow rules regularly is one of the cheapest ways to prevent this kind of avoidable disaster.

The flip side is that well-targeted disallow rules genuinely help. Blocking internal search results, faceted navigation parameters, admin URLs, and other low-value URL patterns keeps crawl budget focused on the pages that actually deserve to be indexed. The art is in being specific: block exactly what you want blocked and nothing more.

Common disallow mistakes worth checking

  • Accidental site-wide block from a stray Disallow: /, often left over from staging.
  • Blocking CSS or JS, which prevents Google from rendering the page as users see it.
  • Blocking images when image search matters to the business.
  • Listing private paths: robots.txt is public, so listing sensitive paths advertises them.
  • Conflicting Allow and Disallow rules where the precedence is ambiguous.

This test surfaces the disallow rules in your robots.txt file. The fix guide below walks through editing robots.txt safely, the difference between robots.txt blocking (which prevents crawling) and noindex (which prevents indexing), and the role of Search Console's robots.txt tester for catching mistakes before they ship.

How do I fix it?

This test surfaces the disallow rules declared in the site's robots.txt file. Disallow directives tell search engine crawlers not to access specific files, paths, or directories, which is useful for keeping admin sections and duplicate content out of indexes but dangerous when applied too broadly. Fixing this issue means auditing each disallow rule and confirming it blocks only what you intend.

Example

User-agent: *
Disallow: /admin/
Disallow: /cart
Disallow: /private/
Allow: /public-section/

Sitemap: https://example.com/sitemap.xml

Where to make the change

  • robots.txt: edit the file at the site root. Add or remove Disallow: lines under the appropriate User-agent: block.
  • WordPress: edit through the SEO plugin's robots.txt editor or by replacing the virtual robots.txt with a real file in the site root.
  • Shopify: edit robots.txt.liquid in the theme code editor to add or override rules.
  • Wix or Squarespace: use the SEO settings panel to override default rules.

Common causes and how to resolve them

  • Accidentally disallowing the entire site: a stray Disallow: / blocks every URL. Audit before deploying changes from staging.
  • Blocking CSS or JS: blocking /css/ or /js/ prevents Google from rendering the page as users see it. Allow these directories.
  • Blocking images: if image search matters, do not block /images/.
  • Listing private paths: robots.txt is public; listing sensitive paths advertises them to bad actors. Use authentication for genuine privacy.
  • Conflicting Allow and Disallow rules: the most specific rule wins, but ordering matters across crawlers. Keep rules simple.

Best practices

  • Use noindex meta tag for individual pages: robots.txt blocks crawling, not indexing. A page blocked by robots.txt can still appear in results without a snippet. Use noindex when you want the page kept out of the index entirely.
  • Test in Search Console: the robots.txt Tester tool simulates how Googlebot interprets your file.
  • Keep the file short and commented: a maintainable robots.txt is one a future engineer can audit at a glance.

Dominate search today on Google and AI Engines.

Join 85,000+ SaaS Marketers, Growth Agencies, Content-Led Companies and E-commerce Brands.

See Pricing
Dashboard preview showing SEO site checkup metrics, page group insights, and issue prioritization