Unable to delete a plugin
If you have ever tried to delete a plugin in WordPress, only to receive an error message saying “Unable to delete plugin” (or a similar error message), you know how frustrating it can be. It’s even more frustrating when you’re unsure why the error is occurring or how to fix it.
Fortunately, there are a few potential solutions to this problem. In this part of the tutorial I will discuss why the “Unable to delete plugin” error message appears and how to fix it.
First, let’s take a look at why this error message appears when you try to delete a plugin.
When you delete a plugin from WordPress, the file isn’t deleted from your server. Instead, WordPress renames the plugin’s folder to something like “plugin-name. old”. This is done so that if you accidentally delete a plugin, you can quickly restore it by simply renaming the folder to its original name.
However, in some cases, WordPress may be unable to rename the plugin’s folder for one reason or another. You will receive the “Unable to delete plugin” error when this happens.
There are a few potential reasons why WordPress may be unable to rename the plugin’s folder. One possibility is that the folder is locked, preventing WordPress from being able to access it. Another possibility is that the folder is located in a protected area of your server that WordPress doesn’t have permission to access.
Solving the “Unable to delete plugin” error
Fortunately, there are a few things you can try to fix the “Unable to delete plugin” error:
One potential solution is to delete the plugin’s folder manually. You must connect to your server via FTP and navigate the “/wp-content/plugins/” folder. Locate the plugin’s folder and delete it.
Once the folder is deleted, you can try deleting the plugin from the WordPress admin area. If the plugin is successfully deleted, you will no longer see the “Unable to delete plugin” error message.
If you’re still seeing the “Unable to delete plugin” error message, or if you can’t delete the plugin’s folder, the folder may be located in a protected area of your server. In this case, you will need to contact your web host and ask them to delete the plugin’s folder for you.
Once the plugin’s folder has been deleted, you should be able to delete the plugin from the WordPress admin area without any problems.
Let’s recapitulate: To solve this error:
- Open your FTP client and connect to your site.
- Navigate to your root directory.
- Go to the WP Content folder.
- Go to the Plugins folder.
- Find the plugin name’s folder.
- Rename it (you can put “plugin_name + – old”).
- Reload your site. If everything is fine, access the plugin folder again (point 5) and rename the folder with the original name. If the error persists, rename it with “-old”, delete that plugin and search for an alternative.
From time to time, a plugin can generate this error due to the cache plugin (simple way), or due to a PHP error (advanced way, I will not specify here how to solve it, because you risk to broke the entire site).