Plugin could not be deleted due to an error: Could not fully remove the plugin(s) my-plugin/my-plugin.php

Why uninstalling the following (empty) plugin results in error?

Here is my-plugin/my-plugin.php:

<?php
/*
Plugin Name: My Plugin
*/

and my-plugin/uninstall.php:

<?php

When I click ‘Delete’ and then confirm, I get the following error:

Plugin could not be deleted due to an error: Could not fully remove
the plugin(s) my-plugin/my-plugin.php.

What’s wrong here?


~/Sites/wordpress/wp-content/plugins/my-plugin $ ls -ll
total 16
-rwxrwxrwx@ 1 me  staff  34 13 Aug 21:43 my-plugin.php
-rwxrwxrwx@ 1 me  staff   6 13 Aug 21:44 uninstall.php

2 Answers
2

I also had the same problem. It was due to the permission issue in wordpress directory. Navigate to the Directory where you have installed WordPress and….
run the following in your terminal:

sudo chown www-data:www-data * -R 
sudo usermod -a -G www-data username

Replace username with the username you are using like root.

Leave a Comment