Table of Contents
InMotion Hosting servers have WordPress Command Line Interface (WP-CLI) installed. Therefore, you can install and toggle a WordPress plugin using SSH in lieu of the WordPress dashboard. You may want to activate a newly uploaded plugin. Maybe a recently updated plugin prevents you from logging into your WordPress site. Or WordFence Security notified you that a plugin hasn’t been updated in over a year and you want to uninstall it for security purposes. Regardless of the reason, below we cover how to deactivate, remove, and update a WordPress plugin via WP-CLI.
Activate and Deactivate Plugins
- SSH into the cPanel account which owns the website.
- Use the cd command to enter the domain’s document root, e.g.
cd public_html
. - Ensure you’re in the correct directory with the following command:
- View the installed plugins for the WordPress website:
- Type the following to activate the plugin, replacing plugin with the plugin name from the wp plugin list:
- Type the following to deactivate the plugin but leave it installed:
- Type the following to activate or deactivate the plugin depending on its former state with a single command:
Remove Plugins
Uninstall Plugins
- Type the following to uninstall a plugin:
Delete Plugins
- Type the following to delete a plugin without deactivating or uninstalling it first:
Note: Whether this fixes an issue better than uninstalling it varies per plugin.
Update Plugins
- Type the following to update a plugin:
You can read more about using WP-CLI in our WP-CLI Education Channel.