To disable, remove or update a plugin in WordPress using WP-CLI, we recommend that you follow the steps described below.

How to Activate and Deactivate plugins

- access the SSH menu from the cPanel account

- use the cd command to enter the root folder of the respective domain, eg:

cd public_html

- Make sure you are in the correct directory by running the following command:

wp option get home && wp option get siteurl    

   https://example.ro
   https://example.ro

- View the plugins installed for the WordPress website:

wp plugin list   

+--------------------+----------+--------+---------+  
| name               | status   | update | version |  
+--------------------+----------+--------+---------+  
| akismet            | active   | none   | 4.0.8   |  
| redirection        | inactive | none   | 3.5     |  
| wp-piwik           | active   | none   | 1.0.19  |  
| wp-super-cache     | active   | none   | 1.6.4   |  
| advanced-cache.php | dropin   | none   |         |  
+--------------------+----------+--------+---------+

- Enter the following to activate the plugin, replacing the plugin with the plugin name in the wp plugin list:

wp plugin activate plugin    

   Plugin 'plugin' activated.   
   Success: Toggled 1 of 1 plugins.

- Enter the following to deactivate the plugin, which will remain installed:

wp plugin deactivate plugin    

   Plugin 'plugin' deactivated.   
   Success: Deactivated 1 of 1 plugins.

Enter the following to enable or disable the plugin, depending on its previous state, with a single command:

wp plugin toggle plugin    

   Plugin 'plugin' deactivated.   
   Success: Toggled 1 of 1 plugins.

How to REMOVE plugins

  • Uninstall plugins

    To uninstall a plugin, enter the following:
wp plugin uninstall plugin   

  Uninstalled and deleted 'plugin' plugin.  
  Success: Uninstalled 1 of 1 plugins.
  • Delete plugins

    To delete a plugin, without disabling or uninstalling it first, enter the following:
wp plugin delete plugin   

  Deleted 'plugin' plugin.  
  Success: Deleted 1 of 1 plugins

How to UPDATE plugins

To update a plugin, enter the following:

wp plugin update plugin

   Plugin updated successfully.
   Success: Updated 1 of 1 plugins.

 

For assistance in applying the above instructions on HostX servers please contact us. HostX offers the fastest WordPress hosting and can help you solve your problems.

Was this answer helpful? 0 Users Found This Useful (0 Votes)