Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm in the process of setting up a (potentially) large multisite network, and I'm looking to make it as easy as possible now to add and configure sites when needed. I'm currently at the phase where I'm dealing with plugins.

With multisite I am aware of several different ways you can activate plugins

  • Put the plugin in /plugins, activate it on every site invidually
  • Put the plugin in /plugins, use 'network activate' to activate it on all sites
  • Put the plugin in /mu-plugins, automatically activated on every site

Now, I've been playing with the settings and I want to activate Akismet on all sites but one or two. I thought I would be able to network activate the plugin and then disable it on a single site, but I am unable to do so - if I use network activate then there is only the option to 'network deactivate' - which deactivates the plugin across all sites.

Is there a way to have the handy functionality of network activate but yet still have the convenience of being able to deactivate plugins on a site-by-site basis?

share|improve this question

7 Answers 7

up vote 19 down vote accepted

You can use the filter site_option_*.

E.g. the following will disable akismet on blog with id 2.

add_filter('site_option_active_sitewide_plugins', 'modify_sitewide_plugins');

function modify_sitewide_plugins($value) {
    global $current_blog;

    if( $current_blog->blog_id == 2 ) {

    return $value;
share|improve this answer
+1 for providing clean, PHP-level solution which solves problem in question without need to install extra plugin -- because I'm a purity maniac and love Wordpress as clean and plugin-less as possible! :] – trejder Nov 12 '12 at 10:14

Here is what worked for me to disable a plugin for one particular theme on a multisite / multitheme install. I added these few lines at the top of the functions.php file in my theme:

 * Disable fancybox plugin for this theme, it breaks javascript
function deactivate_plugin_conditional() {
    if ( is_plugin_active('fancybox-for-wordpress/fancybox.php') ) {
add_action( 'muplugins_loaded', 'deactivate_plugin_conditional' );
share|improve this answer

The active plugins are stored in the wp_[blog_id]_options in the field 'active_plugins' and 'active_sitewide_plugins' in wp_[blog_id]_sitemeta. These are serialised fields so don't edit them unless you know what you're doing.

Also take a look at wp-admin\plugin.php. It should be possible to write a plugin which will do what you want using the functions declared in there e.g. is_plugin_active() and activate_plugin().

However, I'm presupposing you are proficient in PHP which may not be the case.

share|improve this answer

The better way to handel all plugins in Multisite Network is "Plugin Commander" you can find here:

share|improve this answer

This plugin:

bypasses the network activation stuff and does its own. and lets you disable the plugin on a site by site basis.

Update: Looks like this plugin breaks the sitewide tags plugin, so be careful before trying on a production network.

share|improve this answer

Answers from sorich87 and user33465 didn't work for me with Wordpress 4.3. Adding this to theme's functions.php worked:

function deactivate_plugin_conditional() {
    $deactivated_plugin_name = 'lazy-load/lazy-load.php';
    deactivate_plugins($deactivated_plugin_name, false, true);
add_action( 'init', 'deactivate_plugin_conditional' );
share|improve this answer
I can confirm that the earlier upvoted solutions no longer work and that the solution by @gdr does in fact work. – Piet Oct 23 at 3:00

Not out of the box in WP 3, but it would be possible, I think, to override the option using the option_* filters.

Also, it would be sweet if you added the suggestion as a feature request in

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.