Webprogramo

How to set WordPress Plugins loaded by default?

Oh yes! There is an interesting and not so known functionality to set WordPress Plugins loaded and enabled by default (automatically). What does it mean? Is it dark sorcery?.

Not, it is not and is very easy to configure. So, to create this «By default enabled and loading plugins» you have to create a folder inside /wp-content/plugins/ named «mu-plugins» and put inside that folder every plugin you want WordPress to load ALWAYS by default. It means the only way to deactivate those plugins is removing the folder plugin from the mu-plugins folder; then, you can not set the plugin activation and deactivation from your plugins list in the WordPress administrator.

Every plugin inside this folder is a called a MUST USE PLUGIN, and you can also modify this directory from your wp-config.php file with this two constants: WPMU_PLUGIN_DIR to set the folder full path directory and, WPMU_PLUGIN_URL  to establish the folder full URL route, like this.

define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // Must use plugins in your /wp-content/ folder.
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' );

And that’s all! You see? It is very straightforward, painless, and handy tool to make sure your WordPress installation is loading your most necessary plugins by default, always!.