WordPress Command Line Interface (WP-CLI) is a powerful command line utility for WordPress, which is included by default with your hosting plan or server. It can be used to perform many of the actions you would normally complete in the WordPress dashboard, such as installing or updating plugins and themes, managing users, making changes to the site configuration, and much more.
You may wish to remove a plugin that is no longer in use or deactivate a malfunctioning plugin to restore website functionality. Here we cover the steps to deactivate a plugin using WP-CLI.
Related Articles
SSH into Shared Server
SSH into VPS or Dedicated Server
Find the Document Root of a Domain
Disable WordPress Plugins From Database
Install WordPress Plugin Using WP-CLI
Disable WordPress Plugin Using WP-CLI
- Access the server via SSH or using the Terminal in cPanel
- Navigate to the site's document root using the cd command
cd $(docroot.py domain.com)
REPLACE: domain.com with the appropriate domain. - Run the following command to display the currently installed plugins
wp plugin list
- Locate the plugin you need to deactivate and copy the slug from the name column
- Run the following command, replacing "slug" with the slug obtained in the previous step
wp plugin deactivate slug
CAUTION: It is recommended that you create a backup of your database prior to making changes. This can be done using the following command.wp db export
TIP: If trying to deactivate a plugin due to it malfunctioning, you may need to add the --skip-plugins flag to bypass the error.
EXAMPLE:wp plugin deactivate really-simple-ssl --skip-plugins
- If you wish to uninstall the plugin once deactivated, use the --uninstall flag
wp plugin deactivate slug --uninstall
- If you wish to deactivate all plugins, use the --all flag
wp plugin deactivate --all
- If you wish to uninstall the plugin once deactivated, use the --uninstall flag
Comments
0 comments
Article is closed for comments.