Mu-Plugins Not Loading

I was trying to get the mu-plugins working correctly, but the plugin is never activated in Wordpress.

The Bedrock documentation says you just have to set the correct installation path to the mu-plugins directory:

I did this and noticed the plugin wasn’t loading. Digging deeper, the Wordpress documentation says that only plugin files, not plugin subdirectories, work in the mu-plugins directory.

https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/

Since composer is installing the plugin as a subdirectory, mu-plugins/wp-stage-switcher/ the plugin is never activated.

Is the documentation on MU Plugins correct? It seems that if composer will always install the plugin in a subdirectory, Wordpress will never activate this plugin.

As noted in the article, WordPress needs the Bedrock Autoloader to activate mu-plugins in subdirectories. Can you confirm this file is in your project?

1 Like

That file was missing for me. Thanks. Once I added it in the plugins worked.

1 Like