Remove the ability to edit theme in WordPress admin

Published: 24, Oct 2014
PHPUncategorized

When developing sites for clients, sometimes you want the ability to prevent the end user from being able to edit/access the theme source code from the admin panel “Appearance -> Editor” area.  This snippet works great for just that!

// Disable the theme / plugin text editor in Admin
define('DISALLOW_FILE_EDIT', true);

Simply add this line of code to your WordPress themes functions.php file or if you’re using roots, this belongs in custom.php

 

Enjoy!