WordPress Multisite: Restricting plugins by domain

UglyRobot to the rescue

A WordPress Multisite network makes site administration much easier. It lets you run multiple websites on a single WordPress installation. This means you can manage all of your themes, plugins, user accounts and content from one place.

When you add themes and plugins to a multisite installation, they are made available to all sites on the network. Individual sites can then enable and disable plugins as necessary. This is handy for plugins that handle optional functionality, like contact forms and social sharing.

You can also activate plugins across the entire network so that individual sites can’t disable them. This is useful for plugins that add key functionality, like analytics and SEO.

But what if you want to restrict access to plugins on a per-site basis? (And why would you want to do that, anyway?)

Restricting plugins by domain

Consider this scenario: You’re building a WordPress Multisite installation for a network of nonprofit organizations. Each organization gets its own website on the network.

Now let’s say one of these organizations is testing out a new website feature, online fundraising, which the WordPress plugin Give will handle.

Because we’re testing this feature out, we don’t want to make it available to all of the sites on the network. We want to roll it out slowly.

So, how do we restrict the plugin so it’s only available to the sites that we specify?

Multisite Plugin Manager

Multisite Plugin Manager to the rescue!

Multisite Plugin Manager does exactly as the name implies, helping you manage plugins across a WordPress multisite network. According to their WordPress.org plugin description, you can:

  • Select what plugins sites have access to.
  • Choose plugins to auto-activate for all new blogs.
  • Mass activate/deactivate a plugin on all sites in your network (very handy!).
  • Assign special plugin access permissions for specific sites in your network.
  • As Super Admin, you can override all these to activate specific plugins on the sites you choose.
  • Removes the plugin meta row links (Version, Author, Plugin) and any update messages for blog admins.

So let’s go through the steps, shall we?

Prerequisite: Creating a multisite network

If you haven’t set up a multisite network before, don’t worry — it’s pretty easy!

Run a basic WordPress installation, then enable the multisite network capabilities by following the steps outlined in the Codex.

Create your sites

After the network is successfully set up, you’ll have access to the new Network Admin area. You’ll have one address already: the main site that the network is installed on.

You can create more sites through Sites > Add New.

Multisite Add Sites

Note: To make sure the Multisite Plugin Manager works, you’ll need at least two sites created.

Install some plugins

Next we’ll need to install some plugins. I’m using the following for my network:

And making the following ones optional:

Lastly, of course: Multisite Plugin Manager. This is also network activated.

Restricting plugin access

So now we have our sites and our plugins. The next step is to figure out which sites should have access to which plugins.

Let’s take a look at network-wide plugin management options. From the Network Admin area, go to Plugins > Plugin Management.

Multisite Plugin Management

We have a few options with Multisite Plugin Manager.

We can enable plugins across all network sites and we can disable plugins across all network sites.

We can also change the User Control setting, which grants or revokes the ability for users to enable or disable certain plugins.

Multisite Manage Plugins Screen

On my network, I have some conflicting plugins: Postmatic and Epoch are plugins for enabling discussions. Disable Comments, on the other hand, removes discussions. These two plugins shouldn’t overlap.

We also have the Give fundraising plugin, which I only want to enable on a single site.

So how do we do this? The secret is the User Control options.

Configuring User Control options

I don’t want Disable Comments, Postmatic, or Epoch to accidentally be enabled on the same site. I also don’t want Give to be enabled by anyone other than myself, the Super Admin. So I’m going to keep User Control set to “none” for all.

I’m fine with the rest of the plugins being controlled by users, so I’ll set their User Control to “All Users”.

Note: As a Super Admin you won’t see any changes. You can go into the Plugins screen for each site and enable or disable the plugins.

Multisite Plugins Screen

If you log in as a regular Administrator user, however, you’ll notice the difference. The available plugins are entirely dependent on the User Control settings.

Multisite User ControlWrapping up

If you’re looking to manage a network of websites, a WordPress Multisite installation can save you a lot of time.

If you want to restrict plugin access by domain (i.e. on a per-site basis), use Multisite Plugin Manager as a network-activated plugin.

Pay close attention to the User Control settings. These will let you control which plugins can be enabled or disabled by regular network administrators. As the network Super Admin, you’ll be able to override settings for each site.

Also published on Medium.

Image by: emilianofelicissimo via Compfight cc