Being unable to access your WordPress admin area can be incredibly frustrating, especially when you need to activate a crucial plugin to restore your site’s functionality.
Fortunately, you can activate WordPress plugins directly from the database, even if you’re locked out of the admin area.
As website owners, we’ve encountered various WordPress challenges, and we’ve discovered that activating plugins through the database is a fast and effective solution to get everything back on track. This approach minimizes downtime, allowing us to tackle issues and restore functionality with minimal disruption.
In this article, we will guide you through the process of easily activating your WordPress plugins using the database.
When is it Necessary to Activate WordPress Plugins via the Database?
Several common WordPress errors can prevent website owners from accessing the admin area. Often, users need to deactivate plugins without admin access.
However, there are times when a website owner must activate specific plugins to regain access to their WordPress site.
For instance, if an error is preventing you from accessing your WordPress dashboard, and you’ve identified a plugin that can resolve that issue.
Fortunately, WordPress keeps track of active plugins in its database. This allows you to manually input this information directly into the database to activate a plugin.
The only requirement is that the plugin must be installed on your WordPress site, meaning it should be located in the plugins directory of your WordPress installation.
Now, let’s explore how to easily enable or activate a plugin through the database, step by step:
- Step 1: Identify Your Database Name Using the Hosting Control Panel
- Step 2: Find the Active Plugins Setting in phpMyAdmin
- Step 3: Activate a Plugin Through phpMyAdmin
- Bonus: Deactivate WordPress Plugins Using the Database
Step 1: Identify Your Database Name Using the Hosting Control Panel
To activate your WordPress plugins via phpMyAdmin, you first need to determine the name of your WordPress database.
To do this, log into your web hosting dashboard. For this tutorial, we will be using Bluehost.
If you are using a different hosting provider, your WordPress hosting dashboard may appear slightly different.
In the ‘Websites’ tab, switch to the ‘Advanced’ tab and click the ‘Manage’ button next to the ‘File Manager’ option.
This will launch the File Manager in a new window. Here, simply find and click on the public_html directory in the left sidebar.
All the files stored in the public_html directory will now be displayed on your screen.
From here, locate and click on the folder that corresponds to your website’s name in the ‘Name’ column.
Some users may find their WordPress files and folders directly within the public_html directory.
Once you have accessed your WordPress site’s files, find the wp-config.php file in the ‘Name’ section and right-click on it.
This will bring up a menu where you need to select the ‘View’ option.
This will open the wp-config.php file in a new window, allowing you to view your database details.
We suggest copying and pasting your database details, including the username and password, into a notepad application on your computer.
Now that you’ve successfully identified your database’s name, let’s proceed to the next step.
Step 2: Find the Active Plugins Option using phpMyAdmin
After determining the name of your database, return to your WordPress hosting control panel.
In the new interface, navigate to the ‘Advanced’ tab and scroll down to find the ‘phpMyAdmin’ option. Click the ‘Manage’ button adjacent to it.
This action will open the phpMyAdmin application in a new tab in your browser.
Important:Before making any changes, ensure you create a full backup of your database. This backup will be useful if something goes wrong during the process.
Next, select the ‘Database’ tab from the navigation menu at the top of the page.
Once you have done that, find your WordPress database and click the browse button to view its contents.
This will display all the tables in your WordPress database on the screen.
Here, locate thewp_optionstable and click the browse link next to it.
Note:By default, WordPress uses ‘wp_’ as the prefix for table names. Your WordPress database might have a different prefix.
Inside thewp_optionstable, find the row where the option_name is set toactive_plugins.
Then, click on the ‘Edit’ link next to it.
This will bring up a box where you can manually enter the details needed to activate a plugin.
Step 3: Activating a Plugin via phpMyAdmin
WordPress keeps the details of active plugins in a specific format that can be accessed programmatically. To inform WordPress about which plugins to activate, we need to use this same format.
To begin, we will enter the option_value as a:1: and then open a curly bracket ({).
We set this value to 1 because we are activating a single plugin. You can adjust this number based on how many plugins you want to activate.
Next, we will add i:0; after the curly bracket. This step assigns a serial number to the plugin.
Always start numbering from 0 instead of 1.
Next, we will enter the number of characters in the plugin’s name and the PHP file name of the plugin we are activating.
For this, we will type s:24: in the input field. Remember, the character count will vary for each plugin depending on the name and file path.
For example, in this tutorial, we are activating WPForms, which has 24 characters in its name, including the file name as listed in our file manager.
Begin by entering the directory name of the plugin. You can locate it by navigating to the /wp-content/plugins/ folder using the File Manager.
Remember to enclose the plugin’s directory name in quotation marks before entering it.
Following the slash, you need to input the file name of the plugin.
To find the file name, return to the File Manager and open the folder of the plugin you wish to activate.
In this folder, identify the PHP file of the plugin. This file name is what you will need to enter.
Now, return to phpMyAdmin and type in the name of the plugin, ensuring you close the quotation marks.
Next, simply add a semicolon (;) and close the curly brackets (}). The final entry in this example will appear as follows:
a:1:{i:0;s:24:"wpforms-lite/wpforms.php";}
This is how it will appear once you have completed the process.
Next, click the ‘Go’ button to run the command.
Now, navigate to your WordPress dashboard and go to the Plugins » Installed Plugins page.
Your plugin has been activated successfully.
Now, if you wish to activate two additional plugins.
Begin by modifying the number of plugins. Next, update each entry for the plugin you wish to activate.
For example:
a:3:{
i:0;s:47:"all-in-one-seo-pack-pro/all_in_one_seo_pack.php";
i:1;s:35:"insert-headers-and-footers/ihaf.php";
i:2;s:24:"wpforms-lite/wpforms.php";
}
Important Note:We have included line breaks here for better readability. Ensure that your code has no line breaks or extra spaces, as this could prevent it from functioning correctly.
Bonus: Deactivate WordPress Plugins From the Database
In addition to activating plugins, you can also deactivate or remove a WordPress plugin directly from your database if you cannot access your admin area. This method is useful for troubleshooting errors or resolving compatibility issues caused by a plugin.
To proceed, access the cPanel of your hosting provider. This tutorial uses Bluehost as an example. Once logged in, navigate to the ‘Databases’ section and select the ‘phpMyAdmin’ option.
This will open a new tab where you need to choose your WordPress database.
You will now be able to view the tables in the WordPress database. Look for and select the wp_options table.
This will reveal additional rows. Find the option labeled ‘active_plugins’ and click the ‘Edit’ link beside it.
When the prompt appears, simply update the option_value field to a:0:{}. Finally, click the ‘Go’ button to save your changes.
For further information, check out our tutorial on how to deactivate all plugins if you cannot access the WordPress admin area.
We hope you found this guide helpful for activating a plugin via the database. You might also be interested in our beginner’s guide on preventing clients from deactivating WordPress plugins and our recommendations for the best WordPress admin dashboard plugins.
If you enjoyed this article, please subscribe to our YouTube Channel for WordPress video tutorials. You can also connect with us on Twitter and Facebook.



