WordPress Plugins: A Complete Guide on How to Remove (Or Deactivate) Plugins From WordPress

How to Remove or Deactivate Plugins in WordPress

When doing WordPress troubleshooting, you are advised to deactivate all plugins and then reactivate them one by one. This allows you to narrow down which plugin is causing the issue.

If you have a lot of plugins, deactivating and reactivating them manually can be time-consuming. In this article, we will show you how to deactivate all WordPress plugins quickly, but we will also show you how to selectively deactivate plugins if needed.

However, if you already have background knowledge about WordPress plugins and feel confident enough, skip to the “How to deactivate or uninstall a plugin” section.

Key Takeaways

  1. Deactivating a plugin does not uninstall/remove it—there is a difference between deactivating and removing a plugin.
  2. Removing or deactivating plugins that you are not using helps to free up space in your web hosting server and improve the security of your site.
  3. You can deactivate or remove plugins through the wp-admin dashboard, via SFTP, in cPanel, or from the database using phpMyAdmin.
  4. Clean up your database once in a while after deactivating/removing plugins to optimize performance.
  5. As a WordPress developer, you can prevent specific users from installing, updating, or deleting plugins. This is helpful if your client is new to WordPress and might accidentally break something.

Deactivating a Plugin Is Not Removing It: What Is the Difference?

These two terms may be a bit technical—deactivating vs. removing.

Deactivating a WordPress plugin is essentially just turning it off. The plugin will still be installed on your website but will not be active or functional.

Removing a plugin on the other hand, completely deletes it from your WordPress website. Once a plugin is removed, you will not be able to turn it back on without reinstalling it.

So, does a deactivated plugin slow down WordPress?

The answer is no. A deactivated plugin doesn’t have any impact on the performance of your WordPress website. In fact, it is always a good idea to leave deactivated plugins on your WordPress site. That way, if you ever need to use them again, you can easily activate them without going through the process of re-installing them.

Should I Deactivate or Uninstall WP Plugins?

Now that you know the difference between deactivating and uninstalling a WordPress plugin, you may wonder which one you should use.

In general, we recommend that you deactivate plugins that you are not using. This will keep them installed on your WordPress site without slowing it down.

If you are certain that you will never use the plugin again, then you can go ahead and uninstall it. For example, if you are switching to a different plugin that provides the same functionality, then you can uninstall the old plugin.

Why You Should Uninstall a Plugin

As mentioned earlier, uninstalling a plugin removes it from your WordPress site. Once a plugin is uninstalled, you will not be able to turn it back on without reinstalling it.

So, why would you want to uninstall a plugin? Here are a few reasons:

  • You’re not using the plugin, and it’s just taking up space on your server.
  • The plugin is outdated and is no longer compatible with the latest version of WordPress.
  • The plugin is causing errors or conflicts on your website.
  • You’re switching to a different plugin that provides the same functionality.
  • A plugin with a known security vulnerability presents a risk to your WordPress site. If you’re no longer using the plugin, uninstalling it is best.
  • In most cases, deactivating a plugin is sufficient. However, if you find that a particular plugin has a negative impact on your site’s performance, you may want to consider uninstalling it.

Also, deactivated plugins are still executable files. Therefore, they can be a gateway for hackers to access your site if they find a security vulnerability.

Should I Remove Unused WordPress Plugins?

When a user makes a request to your WordPress site, WordPress only loads the active plugins.

However, inactive plugins are still stored on your server. It takes up space on your server, which can affect the performance of your WordPress site.

Usually, if your WordPress site is hosted by a quality WordPress hosting provider, then the performance impact will be negligible. In any case, removing inactive plugins is still a good idea if you’re not planning on using them.

Expert Tip: If your server starts being affected by the number of plugins you have installed, then you should consider switching to a managed WordPress hosting provider. They are designed to handle high-traffic WordPress sites.

1. How to Deactivate or Uninstall WordPress Plugins From wp-admin Dashboard

The easiest way to deactivate or uninstall a WordPress plugin is from your wp-admin dashboard.

First, you need to log in to your WordPress site. Once you’re logged in, you will be redirected to the wp-admin dashboard.

On the left-hand side of the screen, you will see a menu. From there, click on the “Plugins” link.

That will take you to the “Plugins” page, where you will see a list of all the plugins installed on your WordPress site.

To deactivate a plugin, simply click on the “Deactivate” link under the plugin name.

To uninstall a plugin, click on the “Delete” link.

A pop-up will appear, asking you to confirm that you want to delete the plugin. Once you click on the “OK” button, the plugin will be uninstalled.

To delete an already deactivated plugin, click on the “Inactive” tab.

You will see a list of all the deactivated plugins. To delete one of them, click on the “Delete” link under the plugin name. A pop-up will appear, asking you to confirm that you want to delete the plugin. Once you click on the “OK” button, the plugin will be uninstalled.

How to Bulk Disable Plugins From WordPress Dashboard

If you want to disable multiple plugins at once, you can do that from the “Plugins” page.

First, select the plugins you want to disable by checking the box next to the plugin name.

Then, from the “Bulk Actions” drop-down menu, select the “Deactivate” option.

Finally, click on the “Apply” button. That will deactivate all the selected plugins.

2. How to Disable or Uninstall WordPress Plugins via SFTP

In some cases, you may not be able to access your wp-admin dashboard. A plugin may cause this.

In those cases, you can deactivate or uninstall all your WordPress plugins by connecting to your WordPress site via SFTP.

SFTP is a secure file transfer protocol that you can use to access your WordPress site’s files and folders on your local computer.

To connect to your WordPress site via SFTP, you need the following:

  • SFTP client — we recommend FileZilla. To get your SFTP credentials, contact your host.

For example, if you use managed WordPress hosting with Kinsta, they provide this information in the dashboard on the Sites/Info section.

  • Your WordPress site’s hostname
  • Your WordPress site’s username
  • Your WordPress site’s password

Once you have all of that, you can follow these steps:

Step 1: Open your SFTP client and enter your WordPress site’s hostname, username, password, and port.

Step 2: Once logged in, you will see a list of all the files on your WordPress site.

Step 3: From there, you need to navigate to the “wp-content” folder.

Step 4: Inside the “wp-content” folder, you will see the “plugins” folder.

Step 5: To deactivate a plugin, rename the plugin’s folder. Rename it to something like “plugin_deactivate”.

Step 6: Once you’re done, save the changes and close the SFTP client.

All your plugins will now be deactivated. This is because WordPress looks for a folder named “plugins” when it is loading. If it can’t find any folder by that name, then it can’t load any plugins.

How To Deactivate A Single WordPress Plugin Via SFTP

If you want to deactivate a single WordPress plugin, follow the same steps above. But instead of renaming the entire “plugins” folder, you need to navigate to the plugin’s folder, find the plugin you want to deactivate, and rename the plugin folder individually.

For example, if the plugin’s folder is named “woocommerce”, you can rename it to “woocommerce-deactivated”.

Note
Note: To uninstall a plugin, delete the plugin’s folder.

3. How to Disable or Remove WordPress Plugins in cPanel

Sometimes plugin errors can occasionally prevent you from accessing your website. These errors can be from a plugin that isn’t working right. If that happens, you can try disabling or removing the plugin from your WordPress file manager to see if that fixes the problem.

To do that, you need to connect to your WordPress site using cPanel.

cPanel is a web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a website.

Most WordPress hosts provide cPanel as an option for their customers. Your host should provide you with cPanel login details. You can contact them and ask for it if they don’t.

If your WordPress host doesn’t provide cPanel, then you can follow the steps in method 2 above (SFTP).

Step 1: Log into cPanel and open the “File Manager” app.

Step 2: Once you’re in, go to the WordPress installation folder.

Step 3: From there, you need to navigate to the “wp-content” folder.

Step 4: Inside the “wp-content” folder, you will see the “plugins” folder. This folder is located in public_html/MyWordpress/wp-content/plugins.

Step 5: To deactivate a plugin, rename the plugin’s folder. Rename it to something like “plugin_deactivate”. To rename the folder, right-click on the folder and select the “Rename” option.

Step 6: Once you’re done, save the changes and close the File Manager.

Now all you need to do is go back to your WordPress site and see if the problem is fixed. If it’s not, then you can try removing the plugin completely.

To do that, go back to the File Manager and delete the plugin’s folder.

Tip
Expert Tip: After deactivating all your plugins, load your site in incognito mode (private browsing). This will prevent WordPress from loading any cached files.

If your WordPress site loads without any problems, then one of your plugins is causing the issue. You need to narrow down which plugin is causing the problem.

To do that, activate your plugins one at a time. Start by renaming the “plugin_deactivate” folder back to its original name.

Navigate into the “plugins” folder. You will see all your plugins listed there.

Rename the first plugin folder to “plugin-name-1_deactivate”. Now go back to your WordPress site and see if the problem is fixed.

If it’s not, go back to your cPanel and rename the next plugin folder to “plugin-name-2_deactivate”. Repeat this process until you find the plugin that’s causing the issue.

Once you find the plugin, you can delete it from your website or contact the plugin developer for help.

Check here for a more detailed tutorial on how to deactivate all your WordPress plugins at once from cPanel.

4. How to Disable or Remove a WordPress Plugin From the Database Using phpMyAdmin

A plugin may cause an error that prevents you from totally accessing your WordPress site. If that happens, you can try removing the plugin from your database.

Note
NOTE: This method is for more advanced users and should only be used as a last resort.

To remove a plugin from your database, you need to connect to your database using phpMyAdmin.

phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL databases through a web browser.

You will be able to access phpMyAdmin from the cPanel dashboard.

Step 1: Log into cPanel and open the “phpMyAdmin” app.

Step 2: On the left side, you will see a list of all the databases on your server. Click on the database that your WordPress site is using.

Step 3: Once you’re in, you will see a list of all the tables in your database on the left side.

Step 4: Find the “wp_options” table and click on it to open it. In some cases, it may be named wpx4_options or a different prefix. But if it’s named with the suffix “_options”, then click to open it, that’s the right folder.

Step 5: Inside the folder, you will see all the rows in the “wp_options” table.

Step 6: Find the row with the option_name “active_plugins”. You can use CTRL + F to find it.

Step 7: To the left of that row, you will see “Edit”. Click on it.

Step 8: A pop-up will appear. In the “option_value” field, delete everything and click on the “Go” button to save your changes. This will deactivate all plugins but will not delete them.

Step 9: Close the phpMyAdmin tab and return to your WordPress site. It should be working now.

WordPress Cleanup After Uninstalling / Deactivating Plugins

Once you remove the plugins, they leave some data behind, which can take up space in your database. These are called orphaned rows.

They can cause your WordPress site to slow down, and in some instances, they pose a security risk.

That’s why it’s always a good idea to clean up your WordPress database after uninstalling or deactivating a plugin.

How to Remove Extra Files Added by a WordPress Plugin

Some plugins store files outside the main WordPress plugin directory. These files are usually stored in the uploads folder, which is located in the /wp-content/ directory.

When you remove the plugin, these files are not deleted, so you need to delete them manually.

To do that, connect to your WordPress site using an SFTP client and navigate to the /wp-content/uploads/ folder.

Once you’re in, find the plugin that you uninstalled and delete its folder.

Be careful not to delete anything else. Once you delete the plugin folder, all its files will be deleted from your server.

Tip
Expert Tip: Make sure you backup your website before you delete anything.

Removing Unused Shortcodes in WordPress

Plugins shortcodes are great when you need to add dynamic content to your posts and pages.

However, when you delete plugins, their shortcodes are still left behind on your website, which makes your site untidy.

To remove the shortcodes, you need to edit the functions.php file of your WordPress theme.

Step 1: Log in to your WP dashboard and go to Appearance > Editor.

Step 2: On the right side, you will see all the files of your WordPress theme. Find the file named functions.php and click on it to open it.

Step 3: Once the file is open, scroll down to the end and add the following code:

add_filter('the_content', 'zole_remove_unused_shortcode');
function zole_remove_unused_shortcode($content)
{ $pattern = zole_get_unused_shortcode_regex();
$content = preg_replace_callback( '/'. $pattern .'/s', 'strip_shortcode_tag', $content );
return $content;
}
function zole_get_unused_shortcode_regex() {
global $shortcode_tags;
$tagnames = array_keys($shortcode_tags);
$tagregexp = join( '|', array_map('preg_quote', $tagnames) );
$regex = '\[(\[?)';
$regex .= "(?!$tagregexp)";
$regex .= '\b([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
return $regex;
}

This code disables all shortcodes not being used on your WordPress site. Reactivating the plugin will automatically enable the shortcodes.

Tip
Expert Tip: To hide the shortcode from being displayed instead of being removed, you can use the following code:
add_shortcode(‘pluginshortcode’,’_return_false’);

Adding this code to your functions.php file will hide the shortcode but will not remove it from your database.

Replace ‘pluginshortcode‘ with the actual shortcode.

Cleaning Up WordPress Database

When using WordPress, your database will accumulate a lot of data over time. That’s why we recommend doing regular clean-ups of your WordPress database.

There are two ways to clean up your WordPress database:

1. Manually via phpMyAdmin

2. Automatically using a WordPress plugin

To clean up your database manually, you need to log in to your cPanel and open the phpMyAdmin tool.

Once you’re in, select your WordPress database from the left sidebar and click on the SQL tab.

Then enter the following SQL query:

DELETE FROM wp_comments WHERE comment_approved = 'spam';

This query will mass delete all spam comments from your WordPress database.

You can also run the following SQL query to delete feed cache data:

DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient%_feed_%')

Check this article to learn more about useful SQL queries.

If the above method is a bit technical for you, we recommend using the Advanced Database Cleaner plugin.

This plugin scans your database for unnecessary tables and data. It allows you to clean your database by deleting orphaned items such as trash posts, pingbacks, spam comments, etc.

How to Prevent Clients From Deactivating WordPress Plugins

As a WordPress developer, you might want to give your clients the capability to edit the content on their WordPress site without giving them access to deactivate or delete plugins.

Especially if your client is new to WordPress, they might unintentionally deactivate or delete a plugin, which can break their WordPress site or affect the site’s performance.

In some cases, they might deactivate crucial plugins such as security plugins exposing their WordPress site to potential threats.

Method 1. Prevent Plugin Deactivation in WordPress by Using a Plugin

You will use a plugin to prevent users from deactivating plugins in WordPress.

In this example, we will use the User Role Editor plugin. First, you need to install and activate the User Role Editor plugin. With this plugin, you can easily add or remove capability from any user role and create new roles.

Upon activation, go to Users » User Role Editor.

Then select the role you want to edit from the list of available roles. In our case, we are going to edit the Subscriber role.

First, click the “Granted Only” checkbox to see a list of all capabilities granted to this role. In our case, the Subscriber is given the role of “read.”

To edit the roles of the Subscriber (in our case), uncheck the “Granted Only” checkbox. Then from the list of roles, click the checkbox of the roles you would like to assign to the Subscriber. Then click “Update” to save your changes.

Now, if a user with a Subscriber role tries to delete posts or delete a plugin from the WordPress admin area, they will get a message saying, “You don’t have sufficient permissions to do this”.

Tip
Tip: On the left-hand side, you can narrow down to a respective group to filter what kind of roles you want to assign. For example, you can filter by “Pages” to only see roles related to the WordPress pages.

Method 2. Prevent Specific Plugins From Deactivation

In this method, we will show you how to disable specific plugins from being deactivated.

This is useful if you want to prevent a specific plugin from being deactivated.

You need to add the following code snippet to your WordPress site’s theme or child theme’s functions.php file.

add_filter( 'plugin_action_links', 'disable_plugin_deactivation', 10, 4 );
function disable_plugin_deactivation( $actions, $plugin_file, $plugin_data, $context ) {
    if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array(
        'wpforms/wpforms.php',
        'woocommerce/woocommerce.php'
    )))
        unset( $actions['deactivate'] );
    return $actions;
}

This code above will deactivate the link to deactivate WPForms and WooCommerce from the plugin listing page. You can add as many plugins as you want to the array.

The “Deactivate” link disappears below the plugins we put in the code—WooComemerce and WPForms.

Limiting Plugin Access by User Roles and Permissions

Another way of limiting plugin access in WordPress is by using user roles and capabilities. By default, WordPress comes with a few user roles with different permissions. Based on these user roles, you can decide which users can have access to which features of your WordPress site.

If you want to allow specific user roles to deactivate plugins, then you need to wrap the code in a user role check.

add_filter( 'plugin_action_links', 'disable_plugin_deactivation', 10, 4 );
function disable_plugin_deactivation( $actions, $plugin_file, $plugin_data, $context ) {
        if (current_user_can('manage_otions')) {
    if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array(
        'wpforms/wpforms.php',
        'woocommerce/woocommerce.php'
    )))
        unset( $actions['deactivate'] );
    return $actions;
}

In the code above, we have used the manage_options capability, which is only granted to Administrators by default.

You can learn more here about user capabilities in WordPress and how to add custom capabilities to WordPress user roles.

Summary

WordPress plugins are great, but if not properly removed, they can leave behind a lot of unwanted code that can cause security vulnerabilities on your WordPress site or even affect your site’s performance.

We showed you the difference between uninstalling and deactivating a WordPress plugin and how you can safely remove plugins from your WordPress site.

We also went through how to clean up the data left behind after uninstalling a WordPress plugin and how to remove unused shortcodes to prevent them from cluttering your database.

Lastly, we showed you how to disable the plugin deletion feature in WordPress and how to limit plugin access by user roles and permissions.

Further reading (Useful Resources)

  1. What Are WordPress Plugins And How To Manage Them?
  2. How to Install WordPress Plugins: Step-by-Step Guide for All Methods
  3. How to Install a WordPress Plugin Using cPanel
  4. How to deactivate all your WordPress plugins at once from cPanel
  5. What Is a WordPress Theme: A Full Overview and How to Choose One
  6. What is WordPress? An Overview of the World’s Most Popular CMS
  7. How to install WordPress: Choose one of four methods
  8. How to use WordPress: A beginner’s guide to building a WordPress Website

FAQs

1. How Do I Recover a Deleted WordPress Plugin?

If you accidentally delete a WordPress plugin, you can simply re-install it from the WordPress.org plugin repository.

2. Can I Delete a WordPress Plugin Via FTP?

Yes, you can delete a WordPress plugin via FTP. However, we don’t recommend it as it’s easy to accidentally delete the wrong file. It’s always best to remove plugins from the WordPress admin area.

3. Is It Safe to Deactivate Plugins in WordPress?

Yes, it’s safe to deactivate plugins in WordPress. You can always reactivate them later if you need to.

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, userna
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Brief Description FTP data is usually insecure since information (usernames, pa
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to use phpMyAdmin to develop a website (without MySQL experience)

Brief description A web developer who is not well versed into coding websites f
2 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Install MySQL on a Windows Web Server Running Apache

This tutorial will show you how to install the MySQL database on a Windows serve
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top