Back to Blog
PHPWordPressPHPSecurityAdmin

Remove the ability to edit theme in WordPress admin

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.

1 min read
100 words
Remove the ability to edit theme in WordPress admin

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!