How to disable the WordPress Theme and Plugin Editor

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!





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.