Removing cordova plugins from the project

Solution 1:

First, you should list your plugins:

cordova plugin list

With this result, you can simply do:

cordova plugin remove <PLUGIN_NAME>

For example:

cordova plugin remove org.apache.cordova.media

Hope it helps.

Solution 2:

You can do it with bash as well (after switching to your Cordova project directory):

for i in `cordova plugin ls | grep '^[^ ]*' -o`; do cordova plugin rm $i; done

Solution 3:

From the terminal (osx) I usually use

cordova plugin -l | xargs cordova plugins rm

Pipe, pipe everything!

To expand a bit: this command will loop through the results of cordova plugin -l and feed it to cordova plugins rm.

xargs is one of those commands that you wonder why you didn't know about before. See this tut.

Solution 4:

You could use: cordova plugins list | awk '{print $1}' | xargs cordova plugins rm

and use cordova plugins list to verify if plugins are all removed.

Solution 5:

v2.0.0 of cordova-check-plugins enables you to remove all plugins in a project:

$ npm install -g cordova-check-plugins
$ cordova-check-plugins --remove-all

It will attempt to use the Cordova CLI to remove each plugin, but if this fails it will force removal of the plugin from platforms/ and plugins/.

If you also want to remove from config.xml, use:

$ cordova-check-plugins --remove-all --save

Disclaimer: I am the author of cordova-check-plugins