Posted in WordPress

The WordPress mu-plugins folder

A side-effect of WordPress’s “multisite” mode – via which you can create a network of sites all running off the same WordPress installation – is the ability for developers to create a wp-content/mu-plugins directory and in it upload “must-use” functionality that’s “on by default”.

As per name of the directory, wp-content/mu-plugins provides a home for plugins; but unlike plugins you install via the WP admin, plugins placed in wp-content/mu-plugins are activated automatically.

And unlike code added to a theme’s functions file, functions added to a plugin installed in the mu-plugins folder remains available whatever theme is used — making mu-plugins a good spot to stick non-theme-related functionality which you want to remain present if the theme is changed.

More conventionally it’s used to stick plugins that aren’t to show up in the plugins page of the WordPress admin, thereby providing the site admin control over these that other site users don’t have.

The feature was created to enable autoloading plugins across multisite installations of WP: all sites running off a single installation of WP would automatically have this set of plugins installed.

But its availability on non-multisite installations, too, means you can take advantage of it on any WordPress site you build to house “must-use” functionality you want included.

Innerestin’ tidbit gleaned from Justin Tadlock, here. Read more about it in the WordPress Codex.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s