Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Activate/Deactivate WordPress Plugin from CLI  (Read 2316 times)

0 Members and 1 Guest are viewing this topic.

Vinil

  • Guest
Activate/Deactivate WordPress Plugin from CLI
« on: December 01, 2013, 04:34:40 pm »
Hi,

Here I am mentioning how to activate/deactivate a WordPress plugin via command line without accessing the Admin area. For this download the below two files to the root of your WordPress installation.


Code: [Select]
# wget http://www.packetmischief.ca/files/wp/wp_enable_plugins.php
# wget http://www.packetmischief.ca/files/wp/wp_disable_plugins.php

To Deactivate:

Run wp_disable_plugins.php with no parameters to return a list of active plugins:

Quote
# php wp_disable_plugins.php
Active plugins:
- akismet/akismet.php
- broken-link-checker/broken-link-checker.php
- si-captcha-for-wordpress/si-captcha.php

Specify plugin name(s) from above on the command line to disable them.

To disable the plugin run the same command again and append the plugin name. For example -

Code: [Select]
# php wp_disable_plugins.php si-captcha-for-wordpress/si-captcha.php
Disabled 1/1 plugins.



To Activate:

Follow the same procedure to activate the plugin using wp_enable_plugins.php command.

Code: [Select]
# php wp_enable_plugins.php si-captcha-for-wordpress/si-captcha.php