Background

I just installed a wordpress plugin but it showed “install failed”. Then I just clicked “activate” without consideration. Then my wordpress website broke down. ( Don’t click “activate” after a failed installation!)And I could not enter into the back-end again. So I cannot easily delete this broken plugin. I lost much time to solve this problem. So share the experience about this, which involves some instructions about Linux.

Prerequisite

You should have accessed to the Linux system by ssh. In Azure, it is easy to do this, just click “SSH” in the service menu. With other cloud service, you could download ssh file and use PuTTY to access the system.

Delete the Broken Plugin

Now you have accessed to the Linux system.

First, you should find the root directory of wordpress. The feature of the root directory is that it has a subfolder “wp-content”. In my system the directory is /home/site/wwwroot.


cd home/site/wwwroot



And then enter into the “plugin” folder and delete the folder of the broken plugin.


cd wp-content/plugin

rm -rf <plugin name>;



But it might output an error message “Directory not empty”. That means the plugin is being written. So we must kill the process first.

Find the concrete file that is being written. Then obtain the process id and kill it.


ps -ef | grep <filename>;



Then the pid will be shown.


kill -9 <pid>;



The process is terminated now.

And now you could delete the plugin directly.