How Do I Disable All WordPress Plugins Directly From the Database?

By default, WordPress installs many plugins from the WordPress.org plugin repository.

The vast majority of these plugins are benign, but there are a few that can cause security problems or other issues.

One way to disable all plugins installed from the WordPress.org plugin repository is to use the wp_plugins() function to query the WordPress database for all plugins, and then using the disable_plugin() function to disable each plugin.

However, this approach has several drawbacks. First, it requires access to the wp_plugins() function, which can be blocked by a firewall or security plugin.

Second, it requires manual intervention to disable each plugin, which can be time-consuming and error-prone.

A better solution is to use the WP_Disable_Plugin() function to disable all plugins automatically. WP_Disable_Plugin() works by querying the WordPress database for all plugins, and then using the disable_plugin() function to disable each plugin.

WP_Disable_Plugin() is a built-in WordPress function, so it is not blocked by a firewall or security plugin. Additionally, WP_Disable_Plugin() does not require manual intervention to disable each plugin.

Therefore, WP_Disable_Plugin() is the ideal solution for disabling all plugins installed from the WordPress.