How to disable the WordPress Theme and Plugin Editor

- by

AppIcon76x76@2xOne of my readers had a mysterious problem: the WordPress Editor was not showing up under Appearance or Plugins. It’s a handy tool for quick edits to any plugin or theme file, and I’ve relied on it more times than I can count.

Having it enabled is a double-edged sword of course, because with great power comes great responsibility too: make a change to a plugin file and accidentally remove a semicolon from the end of a line, and your WordPress site will go down – and the best minds will have a hard time tracking the problem down.

There is a way to remove the editor functionality completely from WordPress to save tinkerers from themselves: add the following line to the wp-config.php file:

define('DISALLOW_FILE_EDIT', true);

This will remove the Editor from both Appearance and Plugins. The change will be in effect as soon as you save the file and refresh the admin interface.

Screen Shot 2015-03-31 at 10.51.27

Screen Shot 2015-03-31 at 10.36.58

To bring the editor back, simply remove the entire line from wp-config.php, or set the value “true” to “false”.

Many thanks to Dr. Markus Drabe for bringing this puzzle to my attention!



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

1 thought on “How to disable the WordPress Theme and Plugin Editor”

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.