WP Robots Txt source code

By George Pattichis, on WordPress.org since 2012. 40,000+ active installs.

Browse code Download zip

WordPress, by default, includes a simple robots.txt file that’s dynamically generated from within the WP application. This is great, but how do you easily change the content? Below is its source code for every one of its 10 releases, what changed in the latest one, and how often it ships.

What changed in 1.3.6

Released Aug 24, 2026, 1 year after 1.3.5
  • Compatibility with WordPress 7.1
  • Stop HTML-escaping robots.txt output (it is text/plain; this broke URLs with &)
  • Store sanitized plain text instead of esc_html() in the option
  • Decode legacy HTML entities from older saved content
  • Fix default Disallow/Allow paths on subdirectory installs (match core admin_url())
  • Guard sitemap defaults for WordPress 5.3–5.4 and when sitemaps are disabled

6 files changed since 1.3.5: 6 modified, 0 added, 0 removed.

Compare 1.3.5 with 1.3.6

Release history

10 releases since March 2012
  1. 1.3.6 Aug 24, 2026 Compatibility with WordPress 7.1
  2. 1.3.5 Jun 29, 2025 Compatibility with WordPress 6.8
  3. 1.3.4 Nov 30, 2024 Compatibility with WordPress 6.7
  4. 1.3.3 Mar 15, 2024 Add Line Break to allow appending more rules. Thanks @flberger
  5. 1.3.2 Jan 30, 2024 Add translation template
Full WP Robots Txt changelog with diffs

Source of 1.3.6

7 files
Browse all WP Robots Txt 1.3.6 files Browse trunk