Site specific mu-plugins

Site specific mu-plugins

I think we can all admit that WordPress MU is a pretty powerful platform (otherwise, why are you here?), there are numerous advantages to hosting multiple distinct sites and blogs with a single core application and code-base.

One of which is a common collection of plugins. Sometimes, however, you find yourself wanting a bit of variety. You don’t want the overhead of loading all of the sitewide (mu-plugins) plugins on every site.

Some you only want for your own blog, or you want different sites to have distinct sets of plugins. This, of course, can be achieved by putting your plugins in the standard plugins directory, but will reveal them to all who have the ability to activate and deactivate them.

I found myself in this situation recently whilst running a number of sites of a single install. The solution is a rather neat little plugin which allows each site and / or blog to have its very own mu-plugins directory.

Site based mu-plugins plugin

You can grab the plugin for free from the site. The setup is a little bit more involved than a normal plugin, so I shall go through an example set up below.


Above is a screenshot of the sites I have running on my server. Each of these sites, realistically, needs a different set of core plugins, but I don’t want to have to use a different WPMU install for each site OR have all the plugins running for all the sites.

The screenshot below shows an example of the layout for my mu-plugins directory.


In it you can see that I have a single plugin in the mu-plugins directory, which is our site based plugin. You should place any plugin which is common across all sites in the main directory as well, as they will be loaded as normal.

I have setup a sub-directory for each of the main domains that I have specific plugins available for. I will place the plugins for each site in relevant directories.

You can see above that as well as a directory, I have a directory. Plugins added to the directory will be loaded on any blog for that domain. The plugins in the directory are those that I only want loaded on that specific blog.

I hope you can find a use for the plugin. Let me know how it works out for you.