WordPress Robots.txt Generator & Validator

Create and validate WordPress robots.txt files. Prevent Yoast and RankMath virtual file conflicts, protect /wp-admin/ while keeping admin-ajax.php accessible.

Advertisement
AdSense Placeholder: Top Leaderboard Ad (728x90 / 320x50)

Displayed below main page header or above the tool container. • Zero CLS Container

Need to block AI scrapers without hurting organic search traffic?

Read our full technical guide for GPTBot, ClaudeBot, Google-Extended, and Perplexity directives.

Learn How to Block AI Crawlers in Robots.txt
WordPress Preset Active: Pre-configured with WordPress specific checkout protections, dynamic endpoint routing, and AI crawler blocks.
Presets:

User-Agent Rule Blocks (4)

1Rule Block: *
Forbidden directories
/wp-admin//wp-includes//cart//checkout//my-account//*?add-to-cart=*
Exceptions to Disallow
/wp-admin/admin-ajax.php

Bingbot/Yandex rate limit (ignored by Googlebot)

2Rule Block: GPTBot
Forbidden directories
/
Exceptions to Disallow
No explicit allow exceptions defined

Bingbot/Yandex rate limit (ignored by Googlebot)

3Rule Block: ClaudeBot
Forbidden directories
/
Exceptions to Disallow
No explicit allow exceptions defined

Bingbot/Yandex rate limit (ignored by Googlebot)

4Rule Block: CCBot
Forbidden directories
/
Exceptions to Disallow
No explicit allow exceptions defined

Bingbot/Yandex rate limit (ignored by Googlebot)

Sitemaps & Host Directives

https://yourdomain.com/sitemap_index.xml
Yandex / Legacy REP

Live URL Path Access Tester

0ms Real-Time Simulation

Test whether a specific search engine bot or scraper is permitted to crawl a given URL path under your active configuration.

ALLOWED (Crawlable)/wp-admin/admin-ajax.php

Explicitly permitted by directive "Allow: /wp-admin/admin-ajax.php" in User-agent: *

robots.txt
16 lines•356 B
1User-agent: *
2Allow: /wp-admin/admin-ajax.php
3Disallow: /wp-admin/
4Disallow: /wp-includes/
5Disallow: /cart/
6Disallow: /checkout/
7Disallow: /my-account/
8Disallow: /*?add-to-cart=*
9
10User-agent: GPTBot
11Disallow: /
12
13User-agent: ClaudeBot
14Disallow: /
15
16User-agent: CCBot
17Disallow: /
18
19Host: https://yourdomain.com
20Sitemap: https://yourdomain.com/sitemap_index.xml
Deployment Quick Tip

Upload this generated file directly to your web server's root directory so it is accessible at https://yourdomain.com/robots.txt.

Advertisement
AdSense Placeholder: Native In-Feed Ad (Responsive)

Separates the interactive tool output from the deep technical guide. • Zero CLS Container

Direct Answer: WordPress (Yoast, RankMath & WooCommerce) Default Crawler Behavior

WordPress automatically generates a dynamic 'virtual' robots.txt file via rewrite rules if no physical robots.txt file exists in the web root. Plugins like Yoast SEO and Rank Math intercept this virtual file to inject sitemap URLs. However, placing an empty or misconfigured physical robots.txt on your server completely overrides your SEO plugins. Furthermore, blocking /wp-admin/ without an explicit Allow: /wp-admin/admin-ajax.php directive breaks Googlebot's ability to render dynamic AJAX elements and structured data.

Resolving WordPress Virtual Robots.txt Conflicts & Admin-Ajax Crawl Errors

Technical deep dive into WordPress (Yoast, RankMath & WooCommerce) robots configuration quirks and indexing safety

WordPress handles robots directives through a dual architecture: virtual dynamic files generated by WordPress core / SEO plugins, and physical server files located in the root web directory (public_html/robots.txt).

Virtual vs. Physical Robots.txt Files in WordPress

When a crawler requests https://yourdomain.com/robots.txt, the web server (Nginx or Apache) first checks if a physical file exists on disk:

  • Physical File Present: The server returns the physical file directly, completely bypassing WordPress PHP execution, Yoast SEO, and Rank Math filters.
  • No Physical File (Default): The server passes the request to index.php, where WordPress invokes do_robots() and SEO plugins dynamically output virtual directives and XML sitemap pointers.

The Critical admin-ajax.php Allow Directive

A classic technical SEO mistake on WordPress sites is authoring:

# BAD PRACTICE (Breaks rendering):
User-agent: *
Disallow: /wp-admin/

Because Googlebot executes JavaScript and CSS to render pages visually, blocking the entire /wp-admin/ directory prevents Googlebot from accessing /wp-admin/admin-ajax.php. This triggers 'Blocked Resource' errors in Google Search Console. The production-certified standard is:

# PRODUCTION STANDARD:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

WooCommerce Crawl Budget Optimization

For eCommerce stores running WooCommerce, add dedicated disallow rules for dynamic cart sessions and add-to-cart query strings to conserve crawl budget:

# WooCommerce Endpoints:
Disallow: /cart/
Disallow: /checkout/
Disallow: /my-account/
Disallow: /*?add-to-cart=*

How to Configure WordPress Robots Directives (Step-by-Step)

Four proven steps to safely deploy robots.txt rules in WordPress (Yoast, RankMath & WooCommerce)

  1. 1

    Check for Physical robots.txt File in Root

    Use FTP, SSH, or cPanel File Manager to check if a physical `robots.txt` exists in your `public_html` root directory. If present, it will override all plugin settings.

  2. 2

    Edit via Yoast SEO or Rank Math Editor

    If using SEO plugins, navigate to Yoast SEO > Tools > File editor (or Rank Math > General Settings > Edit robots.txt) to configure virtual directives safely.

  3. 3

    Enforce Allow: /wp-admin/admin-ajax.php

    Verify that `Allow: /wp-admin/admin-ajax.php` is placed immediately after `Disallow: /wp-admin/` so Googlebot can execute theme JavaScript and AJAX queries.

  4. 4

    Verify Server Headers & Live Response

    Open `https://yourdomain.com/robots.txt` in your browser or run `curl -IL` to confirm it returns `HTTP 200 OK` with `Content-Type: text/plain`.

WordPress Robots.txt FAQ

Troubleshooting crawler errors, file overrides, and CMS-specific directives

Why is Allow: /wp-admin/admin-ajax.php critical in WordPress?

Many modern WordPress themes and plugins use `admin-ajax.php` to fetch dynamic content, load reviews, and render page components. If Googlebot is blocked from `admin-ajax.php`, it cannot render the full page accurately, triggering 'Page resources cannot be loaded' warnings in Google Search Console.

Why does Google say my robots.txt is unreachable on WP Engine or Kinsta?

Managed WordPress hosts often implement edge caching and security firewalls. If your server returns an HTTP 403 Forbidden, 500 Internal Server Error, or unexpected redirect for `/robots.txt`, search engines treat your entire domain as unreachable and halt crawling. Ensure your caching layer bypasses `/robots.txt` and returns `HTTP 200 OK` with `Content-Type: text/plain`.

Does a physical robots.txt file override Yoast or RankMath virtual rules?

Yes. If a physical `robots.txt` file exists in your server's root directory (`public_html/robots.txt`), WordPress and your SEO plugins (Yoast, Rank Math, AIOSEO) completely stop generating the dynamic virtual robots.txt file. Any changes made in the plugin UI will have no effect until the physical file is updated or deleted.

CMS & Framework Robots Directives

Switch presets to configure and validate robots.txt files for your specific tech stack

Looking for generic robots rules? Use the Universal Robots.txt Generator & Validator.

Related Tools & Next Workflow Steps

Complementary utilities to streamline your SEO audit, indexing, and content strategy.

Browse All 35 Utilities
New

LLMs.txt & AI Crawler Directive Generator

Generate standard /llms.txt files and configure granular robots.txt AI bot directives for OpenAI, Claude, Google, and Perplexity.

technicalOpen
New

XML Sitemap Generator & Validator

Generate standard XML sitemaps from URL batches, customize crawl priorities, and validate existing sitemap XML client-side.

technicalOpen
New

Redirect Rule & Regex Mapper

Generate, test, and export 301 and 302 redirect rules for Next.js, Nginx, Apache, and Cloudflare with real-time regex path testing.

technicalOpen
New

Bulk Canonical Normalizer & Auditor

Audit raw URLs in bulk, strip tracking parameters (UTMs/gclid), enforce trailing slash rules, and detect duplicate content risks.

technicalOpen
Advertisement
AdSense Placeholder: Top Leaderboard Ad (728x90 / 320x50)

Displayed below main page header or above the tool container. • Zero CLS Container