Disabling a failing WordPress plugin from the shell is often the fastest way to restore a site when wp-admin is unreachable or a plugin update breaks every request. The wp plugin deactivate command removes the plugin from the active set without needing the dashboard, which makes it a practical recovery step during incidents and remote maintenance windows.
WP-CLI resolves plugin state against the WordPress installation it boots, so the current directory, site URL, and multisite context all matter. On single-site installs the change is stored for that one site, while on multisite –url targets one site and –network deactivates a network-active plugin across the whole network.
The workflow assumes WP-CLI already works against the site and that the correct document root is known. When a broken plugin crashes during bootstrap, WP-CLI can still skip loading that plugin with –skip-plugins=plugin-slug so the deactivation command can complete, although must-use plugins are still loaded.
Steps to disable a WordPress plugin with WP-CLI:
- Change into the exact WordPress document root.
$ cd /var/www/example.com/public_html
- Confirm the command is targeting the expected site and identify the active plugin slug before changing anything.
$ wp option get home https://www.example.com $ wp plugin list --status=active --field=name google-site-kit
Use the active-plugin list to copy the exact slug instead of guessing from the plugin's display name.
- Deactivate the plugin by slug.
$ wp plugin deactivate google-site-kit Plugin 'google-site-kit' deactivated. Success: Deactivated 1 of 1 plugins.
On multisite, add --url=https://site.example.com to target one site and add --network only when the plugin is network-active for the entire network.
If the plugin crashes before the command finishes, retry with wp --skip-plugins=google-site-kit plugin deactivate google-site-kit so WP-CLI can boot without loading that plugin first.
- Verify that the plugin now reports as inactive.
$ wp plugin list --name=google-site-kit --field=status inactive
An inactive result confirms that WordPress will stop loading that plugin on the next request.
- Re-test the failing admin page or public URL immediately after the deactivation.
If the site is still broken, check the remaining active plugins with wp plugin list --status=active --field=name and then inspect the current theme or any must-use plugins.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
