How to disable plugin from database wordpress

To disable a plugin directly from the database in WordPress, you’ll need to access your site’s database through a tool like phpMyAdmin or via a command-line interface. Here are the steps you can follow:

1. **Backup Your Database**: Before making any changes, it’s crucial to create a backup of your WordPress database. This will ensure you can restore it in case anything goes wrong.

2. **Access the Database**:
– If you’re using a hosting provider, they usually provide a tool like phpMyAdmin. You can find this in your hosting control panel.
– If you’re on a local development environment, you might be using tools like MAMP, XAMPP, or directly accessing MySQL through the command line.

3. **Locate the wp_options table**:
– Once in the database interface, look for a table named `wp_options`. It’s where WordPress stores general settings and plugin information.

4. **Search for the Plugin**:
– In the `wp_options` table, you’ll see a column named `option_name`. Look for rows where the `option_name` starts with `active_plugins`. This is where the active plugins are listed.

5. **Edit the Active Plugins Option**:
– Click on the ‘Edit’ link next to the `active_plugins` row. This will open a text field where you can modify the value.

6. **Disable the Plugin**:
– In the value field, you’ll see a serialized array containing the active plugins. Locate the plugin you want to disable and change its status to `i:0;` (where `i:1;` means active, and `i:0;` means inactive).

For example, if you want to disable a plugin with the name “example-plugin”, you would modify the value like this:

“`
a:3:{i:0;s:19:”akismet/akismet.php”;i:1;s:27:”classic-editor/classic-editor.php”;i:2;s:28:”example-plugin/example-plugin.php”;}
“`
Change it to:

“`
a:3:{i:0;s:19:”akismet/akismet.php”;i:1;s:27:”classic-editor/classic-editor.php”;i:2;s:28:”example-plugin/example-plugin.php”;i:3;i:0;}
“`

7. **Save the Changes**:
– Click on the ‘Go’ button or equivalent to save the changes.

8. **Verify in WordPress Dashboard**:
– Go back to your WordPress dashboard and check the Plugins page. The plugin you disabled should no longer be active.

Remember, making direct changes in the database can be risky if you’re not familiar with it. Always back up your database before making any changes. If possible, use the WordPress dashboard for plugin management, as it’s safer and more user-friendly.

Leave a Reply