Does anyone know a really effective method for disabling a plugin (that is active) on a specific page? There are some plugins that are not really needed in some pages of the website and they have lot of CSS and JavaScript files that are slowing the loading speed of the website and sometimes might conflict with other files.
I know that I can mess with the plugin’s code etc. but it’s not really effective.
Any ideas?
Thanks in advance!
Here is the idea.
p.s. Some people say you might need to put this in
mu-plugins
folder.I know it’s old but this thread was exactly what I needed.
The only caveat to numediaweb’s answer is that remove action requires the same priority as the add action
Hooks in the plugin
Code to remove hooks
From http://codex.wordpress.org/Function_Reference/remove_action
I’ve included my if statement to only run the action on specific post ids, thought it might be helpful.
First check, if the plugin you want to remove doesn’t have an option menu where you set pages to exclude.
Second is, look for your plugin action hooks for ex:
This is an example from easy fancybox plugin that hooks to wordpress header. To remove it, I placed this function in your
functions.php
and before any instance ofwp_head();
is called:you can now use the free plugin Freesoul Deactivate Plugins to deactivate specific plugins on specific pages, posts, custom posts and archives, the settings page is really simple