Disable multisite-wide plugins on specific sites

Multisite-wide active plugins are stored in the active_sitewide_plugins site option. We can hook into this option and return an empty array (no plugins are active).

This snippet should be installed as a Must-Use Plugin.

<?php

/**
 * Plugin Name: Disable Sitewide Plugins
 * Author: Shea Bunge
 * Author URI: http://bungeshea.com
 * Version: 0.1
 */

global $blog_id;

if ( in_array( $blog_id, array( 6, 9, 42 ) ) {
    add_filter( 'pre_site_option_active_sitewide_plugins', '__return_empty_array' );
}

Remember to replace array( 6, 9, 42 ) with an array of the blog IDs you want to disable network-wide plugins on.