What to Do When You Can’t Delete a WordPress Plugin

What to Do When You Can’t Delete a WordPress PluginAre you finding it difficult to delete plugins from your WordPress website?

When building a WordPress website, installing a plugin is inevitable. Although plugins are extremely important as they add more functionality to your site, you will eventually have to delete some from your website.

In this article, we will show you how to properly uninstall a WordPress plugin. We will also explain what to do when you cannot delete a plugin.

Content:

Why you Should Uninstall a Plugin

Plugins help you increase the functionality of your website. For instance, Yoast SEO plugin helps you optimize your content for search engines.

While building your website, you may have installed quite a number of them such as contact form and page builder plugins. Along the line, you discovered a plugin didn’t meet your expectations, so you deleted it. That’s understandable.

Another reason for uninstalling a WordPress plugin is that you may have found a plugin that suits your needs better than the current one. Leaving plugins you’re no longer using not only takes up unnecessary space but also increases your site load times. Your best bet would be to delete them.

Further, leaving unused WordPress plugins can later become problematic. This is because inactive plugins are still executable files, so they are prone to malware infection. When this happens, deleting the plugin may not resolve the issue.

Lastly, a plugin might not be compatible with your site’s theme. This could pose some issues on your website. In such a case, uninstalling the plugin will be the solution.

Deactivating and Uninstalling a Plugin – The Difference

Deactivating and deleting a plugin are two different concepts. When you deactivate a WordPress plugin, you are in essence, rendering it inoperative. This action is best done when you want the plugin shut down temporarily. When its use is needed again, you can simply reactivate it.

On the other hand, deleting a plugin means removing it completely. The process is pretty straightforward. If you find that you need to make use of it again, you can simply install it back. You can check our article to get a detailed guide on how to install a WordPress plugin.

Delete Plugins via the WordPress Dashboard

This is the typical way users delete plugins from their site. On your wp dashboard, navigate to Plugins >> Installed Plugins. There, you will see a list of all extensions on your site, both active and inactive.

You need to first deactivate the plugin before you can completely delete it from your website. To deactivate a plugin, click on Deactivate underneath the plugin.

Delete WordPress Plugin via Dashboard

Once inactive, the Delete button comes up. Click on it to remove the plugin. That’s pretty much it.

How to Uninstall WordPress Plugins via FTP

Another way you can delete a plugin from your WordPress site is via a File Transfer Protocol (FTP) program like FileZilla. To begin, get your credentials from your web host, fill them in the text fields provided, and log in to the FTP server.

Once connected, navigate to the directory containing your WordPress site files. This is usually the public_html folder.

Public_html folder in FTP

Once there, navigate to the wp-content folder, double-click to open it, then open the plugins folder.

delete wordpress plugin via ftp

Find the rogue plugin, right-click and select Delete.

What To Do if you cannot Access Your WordPress Site

In a rare case, a rogue plugin error can lock you out of your site. When this happens, deleting the plugin using the above method will be impossible. If this is your case, do not panic. The rogue plugin can be deleted from your WordPress file manager.

To access it, login to the cPanel of your WordPress hosting account (contact your WebHost for these details if you don’t have them). In the “Files” section, click on File Manager.

File Manager in cPanel

Once it is open, navigate into the wp-content folder.

wp-content in cPanel

After that, double click on the plugins folder to access your site plugins.

Plugins Folder

If you know the plugin that is preventing you from accessing your wp-admin dashboard, simply right-click on the plugin folder and then click on Delete.

Delete WordPress Plugin Via cPanel

However, if you can’t identify the faulty plugin, you need to deactivate all plugins. For this, go back to the wp-content folder. Then right-click on the plugins folder and select Rename.

Rename Plugins folder

Here, simply append “_disabled” to the folder name and click on Rename File. This action will remove all plugins from your website.

Rename File

Now, login to your WordPress site and confirm if you have access to the admin dashboard. If you do, then one of your plugins is faulty and needs to be deleted.

Detecting the Faulty Plugin

To detect the faulty plugin, you need to manually troubleshoot all plugins on your site. Here is how to do it.

First, rename the plugins folder on your cPanel to just plugins. After that, login to your website and then go to Plugins >> Installed Plugins. You will see all the plugins on your website, but they will all be deactivated.

Installed PluginsNow, begin activating the plugins one at a time. Each time, refresh your site to see if you can still access the admin panel.

The plugin you activated just before you lost access to your admin panel is the faulty plugin and should be deleted. You can delete the faulty plugin by opening the plugins folder, and then deleting the folder for that plugin, as we showed above. 

Removing Unused Shortcodes

Some WordPress plugins make use of shortcodes that you insert in a post or page. Oftentimes, when the plugins are deleted, the shortcodes remain as plain text on the post.

Here is an example of how it will be displayed:

[plugin_shortcode]

This can be distracting for your viewers. The shortcodes can be removed manually, but the process is quite lengthy. Disabling the shortcodes is time-saving.

To disable the shortcodes from showing, head on to Appearance >> Theme Editor. Next, locate the functions.php file and click on it.

WordPress Theme Editor

Add this line of code to the file:

// To disable shortcodes
add_shortcode( 'plugin_shortcode', '__return_false' );

 

Replace the ‘plugin_shortcode’ with the plugin’s shortcode tag. Remember to remove the code if you want to use the plugin again.

You can also make use of the Remove Orphan Shortcodes plugin if you do not want to use the above method. This plugin automatically removes inactive shortcodes from your posts/page.

Delete WordPress Plugin Data From Database

The downside to uninstalling a plugin with the cPanel and FTP methods is that some plugins tend to leave behind bits of data. This can have a negative impact on your site performance.

The thing is, some plugins create their own tables and store the data in the WordPress database. When the plugins are uninstalled, the tables may remain in the database. These tables left are referred to as orphaned tables.

Now you can either employ the help of a plugin or delete the database tables manually. Use the manual process if you have some knowledge of WordPress programming. If you do not, use the plugin options instead. Before making any changes to your database, it is important to have a complete WordPress backup of your site.

Manually Removing Plugin Data

To manually remove the tables, you need to access PHPMyAdmin from your hosting server. For this, log in to your cPanel account, scroll down to the “Databases” section, and then click on phpMyAdmin.

phpMyAdmin - delete wordpress plugins

Next, click on your database.

Website Database

Type the name of the table you wish to delete in the text field provided. You can contact the plugin developer or read the plugin documentation if you do not know the table name it uses.

Delete wordpress plugin data via phpmyadmin

After entering the name, it will filter your database to show only tables with the name you entered.

To delete the orphaned tables, first, tick the Check all box to select all entries of this table. After that, click on Drop to completely remove all traces of the plugin.

This action is irreversible, but if you backed up your site previously, the plugin can be restored again.

If you are not comfortable removing the tables manually, then try a database optimizer. We recommend WP-Optimize plugin and Advanced Database Cleaner plugin. Also, go through our guide to learn how to clean up your WordPress database.

 

WP-Optimize

WP-Optimize Plugin

One of the most popular optimization plugins, WP-Optimize comes with tools to enable you clean and optimize your database. The plugin creates space by removing unnecessary post revisions, thus increasing speed and efficiency on your WordPress site.

WP-Optimize is mobile-friendly, easy to use, and has other features beneficial for your site.

Advanced Database Cleaner

Advanced Database Cleaner Plugin

Another great WordPress plugin, Advanced Database Cleaner helps clean up the garbage in your database. With this plugin, you get to schedule the cleanup tasks and specify what should be cleaned.

Additionally, the plugin notifies you if there are any corrupted tables, and repairs them. Advanced Database Cleaner is user-friendly and easy to use.

Remove Leftover Plugin Files with FTP

Not only do some uninstalled plugins leave tables and rows in the database, but they also leave behind folders and files. This is common with caching and security plugins as they create secondary directories for logging.

To remove these extra folders, log in to your FTP client. Remember to backup your wp site before making any changes to your server.

Next, navigate to /public_html/wp-content/plugin. Once there, look for the correct plugin folder, right-click on it and delete it. The steps are the same as the ones we mentioned in the FTP method above.

Side note: You can further go through the .htaccess and wp-config.php files, search for entries added by the plugin and delete them.

Frequently Asked Questions

What is the main reason for not being able to delete a WordPress plugin?

The primary reason is that the plugin files and folders might be set with incorrect permissions, preventing them from being deleted. Additionally, the plugin could be active on your site or might have a conflict with another plugin or theme.

How can I fix incorrect file and folder permissions?

You can fix incorrect file and folder permissions using an FTP client like FileZilla. Connect to your website, locate the plugin folder in “wp-content/plugins,” right-click on the folder, select “File permissions,” and set the permissions to 755 for folders and 644 for files.

How do I deactivate the plugin if I cannot access the WordPress dashboard?

Use an FTP client to access your website files, navigate to the “wp-content” folder, and rename the “plugins” folder to “plugins_old.” This will deactivate all plugins on your site, and you should regain access to the dashboard to deactivate the problematic plugin individually.

How can I check for plugin conflicts?

Deactivate all plugins on your site, then reactivate them one by one, checking your site’s functionality after each activation. When the issue reappears, you will have identified the conflicting plugin.

What should I do if there is a theme conflict?

You can resolve theme conflicts by switching to a default WordPress theme, such as Twenty Twenty-One. If the issue persists, it is likely not related to the theme.

What if I still can’t delete the plugin after trying all the solutions?

In this case, you may need to contact your hosting provider or seek professional assistance. They can help you identify the issue and remove the plugin.

Can I prevent plugin deletion issues in the future?

Yes, always keep your WordPress installation, themes, and plugins up-to-date, and make sure to use well-coded and reliable plugins. Additionally, regularly back up your site to ensure you can quickly restore it in case of any issues.

Conclusion – Delete WordPress Plugin

Performing a complete uninstall on plugins is super important. As we have discussed in this article, some plugins fail to properly delete themselves. Thankfully, most plugin documentation shows how to completely deactivate or uninstall the plugins from your website.

If you do not have the help of a plugin handbook, not to worry. Take a moment to go through our article and learn how to delete those unnecessary data.

Did you find this article helpful? If yes, kindly leave a comment below. You can also go through our wp college to find more helpful tutorials.