On the VIP Platform the
/mu-plugins directory is not directly accessible, and will not appear in a site’s code repository. Instead, plugins can be loaded as MU (“must use”) plugins by adding them to the
/client-mu-plugins directory found in the root of a site’s code repository. The
/client-mu-plugins directory works similarly to
WP_CONTENT_DIR . '/mu-plugins/' in a self-hosted WordPress installation.
- If a plugin consists only of one file, that file can be added to the root of
/client-mu-pluginsand it will load as an MU plugin automatically. For example:
- Plugins that are added to
/client-mu-pluginswith their own subdirectory must be loaded programmatically with a
plugin-loader.phpfile, placed within the
- Only custom plugins with code that needs to be auto-loaded, or code that needs to run earlier in the WordPress load process, should be added to the
- Third-party plugins should be loaded from the
/pluginsdirectory, as many of these plugins utilize the activation and deactivation hooks, neither of which are executed for MU plugins.
- MU plugins behave differently than plugins installed in the
/pluginsdirectory, and the pros and cons of each method should be reviewed and evaluated.
Last updated: December 22, 2023