How to disable a WordPress plugin through the terminal

How to disable a WordPress plugin through the terminal

When updating a WordPress plugin, best practices say one should always backup one’s server and/or content before doing any updates, and that one should always test any updates on a dummy site first, but things happen and sometimes an update can cause your site to white-screen, preventing you from accessing your site. In order to fix this problem you will need to disable the plugin manually. There are several options, but I will be focusing on manually disabling the WordPress plugin files via the terminal.

Manually disabling the WordPress plugin’s files can be accomplished by renaming the plugin’s directory. To do this in the terminal:

  1. Navigate to /var/www/html/wp-content/plugins.
  2. Find the directory of the plugin causing the problem.
  3. Rename the problematic directory to something else (EX. brokenplugin-disabled).

To rename a plugin directory:

  1. Use: mv /var/www/html/wp-content/plugins/OLD_DIRECTORY_NAME /var/www/html/wp-content/plugins/NEW_DIRECTORY_NAME
    • OLD_DIRECTORY_NAME and NEW_DIRECTORY_NAME are the old and new names of your plugin directory.
    • You may need to use sudo to rename your plugin directory.

You should now be able to access your WordPress site.

NOTE: You will receive a small error message indicating that the plugin failed to load due to the fact that the files do not exist. Simply dismiss this message and you’re good to go.

Back To Top