Analizador de Robots.txt

Analiza robots.txt para reglas contradictorias, bloqueos peligrosos y problemas SEO con simulación de URL

Analyzing robots.txt for SEO and Crawl Control

The robots.txt file is the first document search engine crawlers read when visiting your site. It controls which pages Googlebot, Bingbot, and other crawlers can access, directly impacting your site's search visibility. A single misconfigured Disallow rule can remove entire sections from search indexes, while contradictory rules create unpredictable crawler behavior. The Robots.txt Analyzer parses your file structure, detects problematic rules, simulates URL matching for specific crawlers, and identifies configurations that may harm your SEO performance.

Beyond basic syntax validation, the analyzer understands crawler-specific behavior — Googlebot interprets rules differently than other bots, crawl-delay is supported by some crawlers but ignored by Google, and sitemap declarations enable discovery of content not linked from your main navigation. The tool flags dangerous blocks (disallowing CSS/JS files, blocking entire directories unintentionally) and suggests corrections to maximize crawl efficiency while protecting sensitive paths.

User-Agent Groups and Rule Precedence

robots.txt organizes rules into user-agent groups, each targeting specific crawlers. Understanding precedence is critical for correct configuration:

  • User-agent: * — Default rules applying to all crawlers without specific groups
  • User-agent: Googlebot — Rules specific to Google's primary crawler
  • User-agent: Bingbot — Rules specific to Microsoft's crawler
  • User-agent: Googlebot-Image — Google's image-specific crawler

When a specific user-agent group exists, crawlers use ONLY those rules and ignore the wildcard group entirely. This means a permissive Googlebot section overrides restrictive wildcard rules — a common source of unintended exposure. The analyzer detects these precedence conflicts and warns when crawler-specific rules contradict the general configuration.

Dangerous Disallow Patterns

The analyzer detects Disallow rules that commonly cause SEO damage:

  • Disallow: / — Blocks the entire site from indexing. Occasionally intentional for staging sites but catastrophic if deployed to production.
  • Blocking CSS/JS: Disallow: /assets/ or /static/ prevents crawlers from rendering pages properly, harming mobile-friendliness scores.
  • Overly broad patterns: Disallow: /p blocks /products/, /pages/, /pricing/ — anything starting with /p.
  • Query parameter blocking: Disallow: /*? blocks all URLs with parameters, including paginated content and filtered category pages that should be indexed.
  • Contradictory Allow/Disallow: Rules that overlap creating ambiguous behavior depending on which crawler-specific precedence rules each bot implements.

URL Simulation and Crawl Testing

The analyzer includes URL simulation — test whether a specific URL would be allowed or blocked for a given user-agent. This is essential for verifying that:

  • Important pages (homepage, product pages, blog posts) are accessible to crawlers
  • Admin panels, user account pages, and internal tools are properly blocked
  • API endpoints that should not be indexed are covered by Disallow rules
  • Paginated URLs and filtered views follow your intended crawl policy

URL matching in robots.txt uses path prefix matching with limited wildcard support (* for any sequence, $ for end-of-URL anchor). The simulator applies the same matching logic that Google's crawler uses, revealing whether complex wildcard patterns actually match the URLs you intend to block or allow.

Code Examples

robots.txt with Issues Detected by Analyzer

# Problematic robots.txt example
User-agent: *
Disallow: /admin/
Disallow: /api/
Disallow: /assets/       # ISSUE: Blocks CSS/JS rendering
Disallow: /p             # ISSUE: Overly broad, blocks /products/

User-agent: Googlebot
Allow: /                 # ISSUE: Overrides ALL wildcard rules for Googlebot
                         # including the /admin/ block

Sitemap: http://example.com/sitemap.xml  # ISSUE: HTTP, site uses HTTPS

# Analyzer findings:
# - WARN: Disallow /assets/ may block CSS/JS rendering
# - ERROR: Disallow /p is overly broad (matches /products/, /pricing/, etc.)
# - ERROR: Googlebot group allows / without re-specifying needed blocks
# - WARN: Sitemap uses HTTP but site likely uses HTTPS
# - INFO: No crawl-delay specified (acceptable for most sites)

Well-Structured robots.txt

# Production robots.txt — clean configuration
User-agent: *
Allow: /

# Block admin and internal paths
Disallow: /admin/
Disallow: /api/internal/
Disallow: /account/
Disallow: /checkout/
Disallow: /*?sort=
Disallow: /*?filter=

# Allow all assets for rendering
Allow: /assets/
Allow: /static/

# Sitemap declaration
Sitemap: https://example.com/sitemap.xml
Sitemap: https://example.com/blog-sitemap.xml