WordPress has two built-in file editors:
- Plugin File Editor
- Theme File Editor
When using a block theme, both editors will be located under the Tools menu. Otherwise, the plugin editor will be located under Plugins, and the theme editor will be located under Appearance. Both editors provide a similar interface for viewing and editing the files.
You should use the WordPress file editors carefully because you can cause the site to crash with improper changes. For this reason, some administrators and hosting companies disable the editors.
Disabling the editors in wp-config.php
To disable the editors, you can set DISALLOW_FILE_EDIT
to true
in wp-config.php:
define('DISALLOW_FILE_EDIT', true);
To re-enable the editors, you can set DISALLOW_FILE_EDIT
to false
. The default is false, so you can also delete the line or comment it out. To comment out a line, put a hash (#) character at the start of the line.
define('DISALLOW_FILE_EDIT', false);
# Or comment out by putting a hashmark in front of the line
# define('DISALLOW_FILE_EDIT', true);
See How to edit wp‑config.php on WordPress – 3 easy ways for help editing the WordPress configuration file (wp-config.php).
Solid Security Pro
If you use the Solid Security Pro plugin, then you can change the setting through the plugin:
- Go to Security > Settings
- Click Advanced
- Expand WordPress Tweaks Settings
- Check or uncheck Disable File Editor
- Click Save on the bottom of the page
- Refresh
Leave a Reply