Tip: Start typing to get instant search results.
How can I deactivate a WordPress plugin without access to the WordPress backend (/wp-admin)?
On all our servers, wp-cli is installed.
wp-cli is the official command line tool for managing WordPress, and provides many capabilities and conveniences.
It works via SSH, so to use it you need to have SSH access to the server enabled.
When your WordPress admin environment via web is not working (e.g., due to problems with WordPress upgrade), you can deactivate a plugin using wp-cli without accessing the admin panel.
Instructions
Log into the server via ssh.
Navigate to the folder containing the WordPress files with the command: cd public_html
At this stage we can run wp-cli. To see the list of plugins, we run the command: wp plugin list
This shows us a list of the installed plugins in our WordPress.
Find the plugin you want to deactivate from this list and run the command: wp plugin deactivate
Example
$ ssh username@example.trustservers.gr
$ cd public_html
$ wp plugin list
+———————-+———-+———–+———+
| name | status | update | version |
+———————-+———-+———–+———+
| wordfence | active | available | 7.10.7 |
| wordpress-seo | inactive | none | 21.5 |
| contact-form-7 | active | none | 5.8.2 |
+———————-+———-+———–+———+
$ wp plugin deactivate contact-form-7
Success: Plugin ‘contact-form-7’ deactivated.