[SOLVED] Error Updating Plugin: Could not remove the old plugin

If you have a WordPress site, you may come across an error whenever you want to update a plugin. The error could read : Could not remove the old plugin.

I got this error with one of my client’s sites and needed to get a way to overcome it. The obvious route was to delete the plugin and install the new one. However, on deleting, I got the following error: Plugin could not be deleted due to an error: Could not fully remove the plugin(s)

Below are a number of possible solutions you can pursue. But before you begin, make sure that you haven’t reach your site’s quota for disk space. Sometimes, cleaning up your server space can solve the problem.

In case you haven’t reached your server’s disk space quota, try the following:

Solution One: Deleting the Plugin via FTP

The first solution is to log into your host cpanel and navigate to the folder of the plugin you want to upgrade. Next, delete the folder and download an updated ZIP file of the plugin. Upload the updated plugin on the plugin folder.

You can then navigate to the plugins dashboard on WordPress and activate the plugin.

This method may work for you but can be time consuming and hence a pain in the butt. Moreover, you will need to do the process everytime a plugin needs to be updated.

Below is a more permanent solution that will save you time.

Solution Two: Editing the WP-Config File.

The second option is to edit the .htaccess file and the wp-config.php files.

In the .htaccess file, add the following:

<Files wp-config.php>
order allow,deny
deny from all
</Files>

Next, back up your wp-config.php file and add the following line just below the <php? code:

define(‘FS_METHOD’, ‘ftpsockets’);
define(‘FTP_BASE’, ‘/path/to/wordpress/’);
define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’);
define(‘FTP_PLUGIN_DIR ‘, ‘/path/to/wordpress/wp-content/plugins/’);
define(‘FTP_USER’, ‘username‘);
define(‘FTP_PASS’, ‘password‘);
define(‘FTP_HOST’, ‘ftp.example.org‘);

Remember to indicate your FTP username, password and host on the bolded areas. After this, save the file and try upgrading the plugins.  If it works, great.

If Solution Two did not work for you, try solution Three below.

Solution Three: Change Folder Permissions

This solution is what worked for me. I checked and realized all the plugins that had an error were set to permission 555. This means they were not writable. This explains why there was an error whenever I wanted to update them.

What I simply did is logged into my cPanel and changed the folder permission from 555 to 755. After this, I was able to update and activate the plugins without any problem.

There you go. Hope this helps.

If this post helped to solve your problem, buy me a cup of coffee below!

[SOLVED] Error Updating Plugin: Could not remove the old plugin 1

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get more tech stuff like this
in your inbox

Subscribe to our mailing list for occasional amazing tech stuff.

Thank you for subscribing.

Something went wrong.