So the code is for one site, and you want it to be for all except one. You need to change the == part to != in order to do this. This way instead of running the code inside the if on the site with ID 2, it will run on all sites except the one with ID 2.
But I don’t know why you would do this, since you can activate a plugin only on one site by just activating it from its dashboard (you do not need to network activate it).
Related Posts:
- How to use same email for multiple users
- How do I remove/delete an old super admin user?
- Setting up a wordpress network with third level domains
- How will self-hosted WordPress work with Google Page Speed Service?
- Troubleshooting a “You do not have sufficient permissions to access this page” error
- What is the best way to load the WP environment in a subdomain of my multisite WordPress install?
- Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network
- What methods should be used to fend off splogs in a multiuser install? [closed]
- WordPress 3 Multisite using subdomains.- DNS on Cpanel question
- Remove Site Name from register form – Multisite
- Set up collaborative site
- Does the WordPress API work with multisite?
- wp_get_attachment_image_src multisite issue
- Add role across network in multisite
- Transfer Subdomain site to Multisite setup
- WP REST API – Multisite – get posts from all sites
- How to Login Once to an Entire WP Multisite Network
- NGINX Multisite Rewrite rules
- On Multisite: Loop to Show First Four Images of Recent Posts Across Network
- “Preview Changes” button doesn’t show changes for previously published posts/pages
- What is the best way to setup wordpress development environment for freelancers with version control?
- Tax_query not working on multisite
- Get source from the_post_thumbnail
- Can I manage more wordpress sites with one wordpress administrator page? [closed]
- Subsites in Multisite installation throwing 404 error on wp-admin in IIS 7
- Identical members roles on all sites in a multisite
- Fixing media links after importing to multisite
- Creating a better multi-site search experience
- BackPress – which libraries i need to load to work with Multisite?
- How do I maintain static directories on multisite subdomains?
- WP-CLI can’t list posts
- Woocommerce and different checkout field for different countries
- Why is multisite rest API keep giving me results for root site only?
- How to stay logged in on a multisite with different domains?
- wordpress multisite subsite rewrite rules not working for videos
- What should I do? A multisite, a single website or many websites? [closed]
- Custom Post types and Custom fields in Multisite
- Can a user spread virus on my Multisite?
- Login on Multiple Sub-Domains without Multisite
- Prevent images on self-hosted WordPress from being served from WordPress.com
- Use another author.php if different multisite subsite?
- Subsite with different template, and content
- What is best forum script available to integrate with wordpress?
- WordPress multisite fails to create a new site in the network
- Changing path for media upload folder in wordpress multisite
- Link to Network Admin Broken After Switching to HTTPS
- Making 2 WordPress sites mutually searchable and more
- Multi-site get_bloginfo(‘stylesheet_directory’) referring to sub-folder
- Single install or multisite?
- Unable to apply theme to WordPress Network Site install
- How to convert multi-site to single site
- WordPress Folder Multisite – dev, staging, www versions
- Setup a multisite to a running website
- Use WordPress MultiSite (WPMS) with a remote database for each created site
- Networksite/multisite is disabled ?, Why?
- My subdomain on WordPress Multisite has gone
- Network Admin URL is shown to anyone before accessing a blog
- Canonical Resource URLs Across a Multisite Network 2012?
- how to migrate wpmu from one host to the other?
- Multisite WPLANG won’t save
- How to display users with posts published between two dates (Sorted by Post-Count) [Multisite]
- Contact Form 7 in Multisite [closed]
- Child Theme Based on Toolbox Not Found
- Update blog option during create new blog?
- Cannot select signup_meta upon multisite user activation
- MultiSite: new Sites not showing up
- Create a CSS file in plugin folder when theme is activated
- $wpdb->update prefixes database name to table when executing query
- What is the best method of installing WP on multiple add-on domains?
- WP MultiSite: Can’t select database error after changing to new domain
- switch_to_blog() not functioning while querying post_types, Why?
- Different site different div content – Multisite
- Multisite sites output on a single page
- can’t create user without email for an author after converting single site to multisite
- Multisite cookies are being shared across domains unwanted
- multisite – unable to connect to network administration
- Launch Media Library for specific MU site
- Redirect Function Prevents Images from Showing in Front-end Media Uploader
- multiple domains point to same site on WP-MU
- How to convert multisite subdomain from http to https
- One membership area for two websites
- WordPress multisite redirect one custom non www domain to www
- Max number of sub folders
- wordpress multisite config issue needs help
- Multisite install in a subfolder won’t work with www
- Domain mapping breaks some plugin scripts and css
- How to force WP to create a users table in multisite configuration?
- Creating a stand-alone site from a WordPress sub site
- Multisite read_more link displays URL twice
- Whats a good strategy for localising WordPress post and page content?
- Multisite: Run a subdomain install from a directory install
- Updating themes customized by users
- Plugin data shared in Multisite
- WordPress and multisites, the rigth choice?
- Remove blog slug from WPMU?
- WordPress multisite and one database
- Planning on Multisite Before Creating A Network
- Best Way to Setup a Network of WP Sites?
- Trying to create site-wide Active Directory sync with Multisite
- Run WordPress multisite from secondary volume on AWS EC2