How To Disable WordPress Plugins Via WP-CLI?

You can use the WP-CLI (WordPress Command Line Interface) to disable plugins on your WordPress site. Here’s how you can do it:

  • Open a command-line interface (terminal) on your server.
  • Navigate to the root directory of your WordPress installation using the cd command. For example:
cd /path/to/your/wordpress/installation
  • To disable a specific plugin, use the following command:
wp plugin deactivate plugin-name
  • Replace plugin-name with the actual slug of the plugin you want to deactivate. For example, if you want to deactivate the “Akismet” plugin, you would run:
wp plugin deactivate akismet
  • If you want to deactivate multiple plugins at once, you can list their slugs separated by spaces:
wp plugin deactivate plugin1 plugin2 plugin3
  • After running the command, WP-CLI will disable the specified plugins, and you should see a success message for each plugin.

Remember that deactivating a plugin will only disable its functionality. It won’t uninstall or delete the plugin. To completely remove a plugin, you can use the wp plugin uninstall command.

Leave a comment

Your email address will not be published. Required fields are marked *