How to Enable and Disable WordPress Plugins from Database @ WordPress Help

How to Enable and Disable WordPress Plugins from Database @ WordPress Help


Put yourself in a situation…

For some reason you cannot access the administration of your WordPress website and would need to access it activate or deactivate a pluginor whatever to – exactly – access it or make something work that fixes the problem that broke your site or the admin.

It sometimes happens when plugins are disabled and one or two of them allow admin access (access url changes, security checks, etc.).

In a situation like this, it’s good to know that there is a way Enable and disable WordPress plugins from database…

How to activate plugins from database

The options table to the rescue

The functionality to enable plugins resides in the database of your WordPress installation. opens the PHPMyAdmin tool from your hosting panel.

Access the phpmyadmin site tools siteground

Look for the table in the utility options (wp_options by default or with the custom prefix yours has).

Tabla Options WordPress phpmyadmin

What is my database?

By the way, If you have multiple databases and don’t know which the affected WordPress installation is, you can identify them in two ways. You can open the options table we are already in and see the options mentioned siteurl j home match your website address.

Siteurl and Home tabla options WordPress phpMyAdmin

Or, if you prefer and have access, check out the archive wp-config.php of your installation and look at the database name in the constant DB_NAME.

Database name wp config wordpress

But how beautiful are the active_plugins

Once the table was found we returned to where we were options Click on it in your database to see the options and search for a name active_plugins.

Opcion active plugins tabla options wordpress phpmyadmin

Click on the link “Edit» to open the option and add our list of plugins to activate, which we will paste in the field labeled option_value.

option value active plugins tabla options wordpress phpmyadmin

Option values ​​to enable plugins from database

Now the good part begins: we’ll learn to tell WordPress which plugins we want to activate based on the database. The only requirement is that they are already installed.

The format is strange, especially when you see it for the first time, but you get it right away. An example would be the following:

a:1:{i:0;s:15:"worker/init.php";}

I explain what each element means:

  • a: – indication that we will specify which plugins should be active (A from active)
  • 1: – We indicate how many plugins we will activate, in the previous example one.
  • {} – Between the brackets we indicate which plugins we will activate.
  • i:0; – The serial number that we assign to the plugin that we want to activate (from 0 to the total number). Since he is the only one in the example, he is assigned the lowest number.
  • s:15: – This is the most unusual as it is the number of characters added to the folder (not including the initial slash) and the plugin executable in the folder /wp-content/plugins/. In the example the plugin would be in the path /wp-content/plugins/worker/init.phpand if you add the characters from worker/init.php 15 come out.
  • "worker/init.php"; – The path to the plugin executable, in this case the ManageWP Worker plugin that I use a lot.

With all of this, to enable this plugin, we would simply add the above values option_value and we would press the “Next” button to save the changes.

Activate 1 plugin from table options database phpmyadmin WordPress

And then you can check if the plugin is active on your WordPress site.

WordPress plugin enabled from phpmyadmin database

How to activate multiple plugins from database

To keep the overview, we now activate several plugins at the same time and at once. Here is an example:

a:4:{
i:0;s:15:"worker/init.php";
i:1;s:27:"coblocks/class-coblocks.php";
i:2;s:36:"contact-form-7/wp-contact-form-7.php";
i:3;s:27:"sg-security/sg-security.php";
}

What have we already learned from these values?

  • a:4: – We will activate 4 plugins.
  • {} – Between these brackets are the values ​​of the 4 plugins to be activated, separated by ; any value.
  • i:número; – Serial number that we assign from scratch to each plugin to be activated.
  • s:número: – Number of characters adding the path of the plugin and its executable. Sum in each example and you will see that it agrees.

Now if we add these values ​​as option_value We will activate these 4 plugins.

As you will see on the screenshots (trust them, they are real) works perfectand surely at some point you will remember this trick and it will save you some problems with your WordPress.

It’s not the easiest tutorial I’ve ever written, but it’s not really complicated either. Just have a look at the values ​​and how they are made.

Hey, now that I’m down! And disable plugins from the database?

Oops, thanks, I almost forgot!

Of course it is very simple and besides You can disable plugins from the database in two ways.

Why the first method you are already imagining?

… …

… … …

Exactly!

Delete all values the option option_value and save.

But and the second option? Well similar. You just have to like option_value the next:

a:0:{}

Or what is the same: Active plugins?, null, none.

Disable all plugins from PHPMyAdmin options database for WordPress

The disables all plugins that they were active.

On the other hand, if you only want to disable one or more of the assets, simply delete their values ​​and leave active the ones you want to keep. what was easy

Did you like this article? You have no idea what you’re missing a YouTube!



Source link

Related Posts

Leave a Reply

Open chat
Scan the code
Hello 👋
Can we help you?