JPKCom Rank Math Options — Guide & Tips
Use JPKCom Rank Math Options to unlock the robots.txt/.htaccess editors despite DISALLOW_FILE_EDIT, remove Rank Math credits and disable telemetry, with zero configuration.
JPKCom Rank Math Options is a lightweight companion plugin for Rank Math SEO. Rank Math disables its robots.txt and .htaccess editors whenever the WordPress constant DISALLOW_FILE_EDIT or DISALLOW_FILE_MODS is set. This plugin re-enables them through the official rank_math/can_edit_file filter and trims a few Rank Math defaults most operators end up disabling anyway. There is nothing to set up: activating it is enough.
Please note: because that is the only condition Rank Math checks, re-enabling the editors means overriding those constants where they are set. On Apache,
.htaccessis effectively server configuration — activate this plugin only where that is intended.
Verified against Rank Math 1.0.275.
Guide
Requirements
- WordPress 6.9 or newer (tested up to WordPress 7.1)
- PHP 8.3 or newer
- Rank Math SEO must be installed and active — the plugin header declares
Requires Plugins: seo-by-rank-math, so WordPress prevents activation otherwise - Network-ready: can be network-activated on multisite and takes effect on every site
Installation
- Upload the
jpkcom-rank-math-optionsdirectory to/wp-content/plugins/, or install the ZIP via Plugins → Add New → Upload Plugin. - Activate the plugin (network-wide on multisite) under Plugins → Installed Plugins.
- Make sure Rank Math SEO is active.
- Open Rank Math → General Settings → Edit robots.txt or Edit .htaccess — the editors are now available.
Configuration
There is nothing to configure — activating it is enough. If you want to disable the behaviour temporarily without deactivating the plugin, you can unhook the filter from another plugin or your functions.php:
remove_filter( 'rank_math/can_edit_file', '__return_true' );Tips & Tricks
- Why the editors are missing in the first place: Rank Math checks a single condition — whether
DISALLOW_FILE_EDITorDISALLOW_FILE_MODSis defined and true in yourwp-config.php. If neither is set, the editors are already available and this plugin changes nothing there. Multisite makes no difference of its own. (Up to version 1.0.9 a different explanation stood here — the multisite reasoning was simply wrong.) - Cleaner source & sitemap: The "Powered by Rank Math" HTML comment in the frontend and the "Generator" line in the XML sitemap are removed.
- Telemetry off — actually, since 1.0.10: Rank Math's switch is the standalone
rank_math_mixpanel_optinoption. The plugin filters every read of it tofalse, soOptin::can_track()reports off no matter what is stored, and it also blocks writes to that option, so an opt-in never reaches the database. Deactivating this plugin therefore leaves tracking off rather than quietly switching it back on. Relevant for existing installations: up to version 1.0.9 the plugin rewrote ausage_trackingkey inrank-math-options-general— a field that is never stored there and does not govern the tracking state either. Tracking was therefore not actually switched off. If you relied on that, this update matters. - Spec-compliant llms.txt: Rank Math prepends an intro paragraph to the generated
llms.txt; the plugin strips it so the file starts with the site's H1 as the spec expects. Since 1.0.10 this runs through therank_math/llms_txt/remove_creditfilter that Rank Math has since added for exactly this. The previous approach compared the request path against the literal/llms.txtand therefore never ran on a subdirectory installation — precisely the case it was written for. - Tidy admin bar: The Rank Math menu node is removed from the WordPress admin bar (frontend and backend).
- No database writes: The plugin only hooks into Rank Math filters — no UI, no options, no database entries of its own.
Further reading
- Source code on GitHub: https://github.com/JPKCom/jpkcom-rank-math-options
- Rank Math SEO: https://wordpress.org/plugins/seo-by-rank-math/
- This project's changelog