In WordPress, there is a special folder in wp-content
: mu-plugins
which stands for Must Use Plugins. WordPress automatically loads all PHP files in this folder. This is a very cool features if you want to always turn on some plugins such as debugging plugins, SEO plugins or functionality plugin for your blog. The problem is WordPress doesn’t load files in sub folders, that means when you put a plugin as a folder into mu-plugins
, it won’t be loaded.
To solve this problem, I use a simple trick: create a simple PHP file in mu-plugins
and include all plugins’ main files.
For more details, let’s look at my mu-plugins
:
As you see, there’s a PHP file load.php
, and this file contains only these lines:
<?php
include 'inspector/inspector.php';
include 'monkeyman-rewrite-analyzer/rewrite-analyzer.php';
include 'wordpress-reset/wordpress-reset.php';
include 'wordpress-importer/wordpress-importer.php';
Now, when I go to Plugins menu, I see the PHP file is loaded as well as needed plugins:
Now I have a bunch of debugging plugins always activated. This saves me a lot of time when developing themes, plugins and fixing bugs. Putting those plugins in mu-plugins
folder also is a good way to organize plugins files. For more information about Must Use Plugins, please read more at the Codex.
Very cool tip Rilwis, never thought about it and it is so trivially simple 🙂 Thanks for sharing!
I have some email marketing plugins that I need to update. Going to try this out to keep certain plugins running on my test install.
Brilliant solution! I never had this problem, so I never know.
Hi Rilwis,
Great tutorial, i have a self hosted wp-blog other than my blogger. Though i am a newbie blogger, i am having fun learning new things from experienced ones such as yourself!
Thanks for the help,
Piyush