Skip to content

How-to Guides

Technical References

Plugins /

client-mu-plugins directory

In addition to the directory of mu-plugins that loads by default into all VIP environments, there is a dedicated client-mu-plugins directory in the root of the site git repository. This directory works similarly to WP_CONTENT_DIR . '/mu-plugins/' in a self-hosted WordPress installation.

If you want your plugins to be installed as MU (“must use”) plugins then you can place them in the client-mu-plugins directory. We strongly recommend that only custom (and not third-party) plugins go in the client-mu-plugins directory, depending on the preferred loading behavior. Specifically, client-mu-plugins should be for any code that should be auto-loaded or run earlier in the WordPress load process.

MU plugins behave differently than plugins installed in the plugins directory, so be sure to read up on the pros and cons and make a measured choice. If you have any questions, we’re happy to help.

Note

Plugins contained within a directory in the client-mu-plugins directory will need a “loader” file in the root of this directory to require the main plugin file.

The contents of the loader file can be as simple as:

<?php

require WPCOM_VIP_CLIENT_MU_PLUGIN_DIR . '/my-plugin/my-plugin.php';

Last updated: November 24, 2020