/client-mu-plugins directory
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:/client-mu-plugins/plugin-name.php. - Plugins that are added to
/client-mu-pluginswith their own subdirectory must be loaded programmatically with aplugin-loader.phpfile, placed within the/client-mu-pluginsdirectory. - 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
/client-mu-pluginsdirectory. - 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: August 08, 2024