In this example, I have shared how to disable plugin using theme code in WordPress? Use following code in your theme’s functions.php file OR in site specific plugin.
1 2 3 4 5 6 | function deactivate_plugin_conditional() { if ( is_plugin_active('plugin-folder/plugin-name.php') ) { deactivate_plugins('plugin-folder/plugin-name.php'); } } add_action( 'admin_init', 'deactivate_plugin_conditional' ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.