WordPress Plugins and Plugins are the lifeblood of WordPress. I was recently contacted by a client who told me that their site was broken and had lost functionality. I then explained that this was due to a plugin integrated into their site. WordPress plugin because of the deactivation.
But even though we activated the plugin via the dashboard, the plugin was automatically deactivating itself. In such cases, we can activate the WordPress plugin in a few different ways.
1. Try reactivating using functions.php
// Add this code to your theme's functions.php file
function activ_plugin_manually () {
$ active_plugins = get_option ('active_plugins');
array_push ($ active_plugins, 'plugin directory / filename.php'); / * Change plugin directory and filename.php to match your main plugin file * /
update_option ('active_plugins', $ active_plugins);
}
add_action ('init', 'activ_plugin_manually');
2. Add your plugin PHPMyAdmin activate via
This method is the most complicated as you will need to find the name and value in your wp_options table of your database.
Find the line with the "Active_plugins" option and you will see the value as follows:
a:4:{
i:0;s:25: "nameofplugin/filename.php";
i:1;s:26: "nameofplugin/filename2.php";
i:2;p:26: "nameofplugin/filename3.php";
i:3;s:26: "nameofplugin/filename4.php";
}
To activate your plugin you need to add your plugin to the array of values, for example:
a:5:{ i:0;s:25: "nameofplugin/filename.php"; i:1;s:26: "nameofplugin/filename2.php"; i:2;p:26: "nameofplugin/filename3.php"; i:3;p:26: "nameofplugin/filename4.php"; i:4;p:39: "nameofplugin/this-is-the-new-plugin.php"; }
Hopefully one of these methods will solve your problem.
If you have solutions for this situation, please write in the comments 🙂
great sharing tskrler you are super