WP Robots Txt source code
By George Pattichis, on WordPress.org since 2012. 40,000+ active installs.
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.
- inc/class-robtxt-admin-page.php modified, +1,720 bytes
- inc/core-functionality.php modified, +506 bytes
- languages/wp-robots-txt-en_US.po modified, +652 bytes
- languages/wp-robots-txt.pot modified, +360 bytes
- readme.txt modified, +1,301 bytes
- robots-txt.php modified, same size
Release history
10 releases since March 2012- 1.3.6 Aug 24, 2026 Compatibility with WordPress 7.1
- 1.3.5 Jun 29, 2025 Compatibility with WordPress 6.8
- 1.3.4 Nov 30, 2024 Compatibility with WordPress 6.7
- 1.3.3 Mar 15, 2024 Add Line Break to allow appending more rules. Thanks @flberger
- 1.3.2 Jan 30, 2024 Add translation template