Celebrate Our 22nd Anniversary with Huge Savings! Up to 70% Off

How to disable the upload button in the plugin and theme of WordPress through wp-config?

Controlling how your WordPress website looks and works is essential. Usually, you use the WordPress dashboard to add or remove plugins and themes. But sometimes, you need a more specialized way to do this. In this guide, we'll show you how to use the wp-config.php file to have more control over your site's plugins and themes, allowing you to customize it just the way you want.

Here are the steps to disable the upload button in WordPress plugins and themes:

Note: This way mainly stops you from changing files in plugins and themes, but you still need to add files in other ways, like putting pictures or videos in your posts or pages. If you want more control over adding files, use a special plugin or write your code.

Step 1: You can access your WordPress files using FTP (File Transfer Protocol) or a file manager that comes with your hosting control panel.

(Here are steps for cPanel)

Step 2: Login into your cPanel account.

Step 3: In the file section, Look for the File Manager. Click on it.

Step 4: In the file manager, go to the main folder where your WordPress is installed. Usually, you'll locate the wp-config.php file right there. Choose the file, then use the menu's Edit or Code Edit option.

Step 5: Within the code editor, scroll through the code until you identify a suitable location to insert the code snippet defined ('DISALLOW_FILE_EDIT,' true). Position it right before the line that reads /* That's all, stop editing! Happy publishing. */.

After adding the code, save the changes. You should click a Save or Save Changes button, depending on your file manager.

When you've added this code to your wp-config.php file, the "Edit" buttons for plugins and themes in the WordPress admin area won't work anymore. This stops users from messing with plugin and theme files directly from the WordPress dashboard.

But be careful when you're tinkering with configuration files like wp-config.php. Messing up can mess up your whole WordPress site! So, before you make changes, ensure you've backed up your files. If you need to figure out what you're doing, getting help from a WordPress expert or your hosting support team is a good idea.

That's all.


Was this answer helpful?

« Back