How to disable a network enabled plugin for just one site?

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 ) {
        unset($value['akismet/akismet.php']);
    }

    return $value;
}

Leave a Comment