Skip to content

robots.txt on WordPress

WordPress generates a virtual robots.txt dynamically. It doesn't exist as a physical file on disk.

Default content

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://yoursite.com/wp-sitemap.xml

Common issues

  • Yoast overrides — Yoast SEO takes control of robots.txt. Edit via Yoast → Tools → File editor.
  • Staging settings — Check Settings → Reading → ensure "Discourage search engines" is unchecked.
  • Plugin conflicts — Use only one SEO plugin's robots.txt management.