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!
try "Plugin Organizer" Wordpress plugin by Jeff Sterup. You have to enable "Selective Plugin Loading" under it's settings (make sure to follow their directions given for enabling it)
Then in your post/page editor there is a box below the compose window with tickboxes to disable whichever particular plugin for that page
took me probably 20+ Google and Wordpress plugins repository searches to finally find a simple solution. Hope it works for you too!
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
Here is the idea.
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.