X

How to Disable Theme and Plugin Editors in WordPress

Snippets by IsItWP

Do you want to disable theme and plugin editors in WordPress? Our snippet not only disables theme and plugin editors, but it also disables the ability to delete plugins.

Instructions:

All you have to do is add this code to your wp-config.php file on your WordPress install.

define( 'DISALLOW_FILE_EDIT', true );
define( 'DISALLOW_FILE_MODS', true );

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 62 best free WordPress blog themes or 7 best WordPress contact form plugins.

Comments   Leave a Reply

  1. if you leave define(‘DISALLOW_FILE_MODS’,false); too this will affect auto-update WordPress (since 3.7)

  2. Do you know how to fix this problem:

    I added:

    define(‘DISALLOW_FILE_MODS’,true);
    define( ‘DISALLOW_FILE_EDIT’, true );

    to wp-config.php and then when I deleted it, the plugins did not come back.

    I tried changing them to:

    define(‘DISALLOW_FILE_MODS’,false);
    define(‘DISALLOW_FILE_EDIT’,false);

    but that did not work.

    Any clues? Thanks.

  3. This one is very useful for making sure customers don’t mess with plugins and editor setting. Thanks!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!