How to Disable Theme and Plugin Editors in WordPress

WordPress allows users to edit the theme and plugin codes by default through the admin panel. While it is a handy feature, it can be very dangerous as well. A simple typo can end up locking you out of your site unless of course you have the FTP access. To prevent clients from screwing up the site, it is best to disable the theme and plugin editors from the WordPress admin panel. In this post, we will share with you a one line code that will disable theme and plugin editors functionality from WordPress.

All you have to do is open your wp-config.php file and paste the following code:

1

define( 'DISALLOW_FILE_EDIT', true );

And you are done.

One of our users pointed out that if you paste this code in the theme’s functions.php file, it also works.