How to Disable and Enable Plugin and Theme Upload Feature on WordPress

By | December 14, 2023

Perhaps, you are a WordPress Developer who just completed a web design project and you are curious about finding a way to prevent your client or a third party from changing the theme or plugins on the website. You are scared that changing the theme or adding new plugins might affect the responsive design or slow down the site speed. Or maybe you are just a site owner who wants to delegate your blog to a manager and you are worried he might be tempted to practicalise some plugin and theme uploads just to get a look at how it feels.

HOW TO DISABLE THEME AND PLUGIN UPLOAD FEATURE ON WORDPRESS

Good news, you can disable the plugin and theme upload features by adding a simple block of code to your wp-config.php file. Go to the CPanel or DirectAdmin hosting panel of the website you want to effect the change on. Locate the root directory of the domain (you can do this through the file manager or domains section).

Next, you would want to locate the wp-config.php file. Right-click on it and select to edit the file. Scroll through the codes downwards and just below this code that says:

/* Add any custom values between this line and the "stop editing" line. */

Add this block of code under the above line:

define('DISALLOW_FILE_MODS', true);

After adding the code above, it should look like this:

/* Add any custom values between this line and the "stop editing" line. */


define('DISALLOW_FILE_MODS', true);

/* That's all, stop editing! Happy publishing. */

Now, you can save the file and be rest assured that no one can add or delete a theme or plugin on the website. It is possible to deactivate a theme or plugin in this mode but it cannot be deleted.

HOW TO ENABLE THEME AND PLUGIN UPLOAD ON WORDPRESS

To enable the theme and plugin upload feature on your WordPress blog, you must return to the wp-config.php file and look for the code below.

define('DISALLOW_FILE_MODS', true);

Remove it once you find it and save the file. Return to your WordPress blog and you would be able to upload and delete themes and plugins now. If you are facing issues or have further questions regarding the subject, kindly use the comment section and I will do my best to assist you through.

Leave a Reply

Your email address will not be published. Required fields are marked *