Like the blog? Get the book »

The Difference Between WordPress Plugins, Must-Use Plugins, and Drop-In Plugins

The Difference Between WordPress Plugins, Must-Use Plugins, and Drop-In Plugins

Anyone familiar with WordPress probably has heard of plugins. They can add new functionality to any WordPress-powered site. But probably not everyone is familiar with two other types of plugins, referred to as Must-Use plugins and Drop-In plugins. Yes there are three types of plugins for WordPress: regular plugins, must-use plugins, and drop-in plugins. Each of these enables you to extend and modify WordPress features with a few clicks. This DigWP post explains the difference between all three. And as a bonus, explains a fourth way to extend WordPress, via the theme functions file. Let’s dig in..

Contents

Regular Plugins

Central to WordPress functionality is its extensibility. WordPress makes it easy for site administrators to add, modify, and remove just about anything that is needed. Simply visit the Plugins screen in the WordPress Admin Area and you’re off to the races. From there you can browse available plugins via the WP Plugin Directory, which currently offers over 59,000 free plugins. That’s a LOT of ways to customize and extend WordPress.

Screenshot showing the WordPress Plugins screen (including some added plugins)

From the simplest one-line-of-code plugins to more advanced plugins that provide many features, WordPress plugins make it easy for any admin to install and activate with a few clicks. Once activated, many WordPress plugins provide a settings screen, where users can learn more about available features and customize options to suit their needs. Other plugins do not provide a settings screen; they simply work with no configuration required.

To help users familiarize themselves with plugins and how they work, the default WordPress installation includes two pre-installed plugins:

  • Hello Dolly — a simple plugin that displays quotes from a song
  • Akismet — a more advanced plugin that can help protect against comment spam

But enough about “regular” WordPress plugins, let’s look at the next type of plugin: the Must-Use plugin..

Must-Use Plugins

Used mostly by developers and advanced users, Must-Use plugins (also known as “mu-plugins”) are installed inside of their own folder named mu-plugins, located in WordPress’ /wp-content/ directory. Here is a visual:

Screenshot showing the location of the must-use plugins (mu-plugins) directory
Note: The /mu-plugins/ directory is not included with default WordPress installations, so you will need to add it manually if you want to add some must-use plugins to your site.

To add a must-use plugin to your site, simply upload it to the /mu-plugins/ directory. There it will be enabled and loaded automatically until removed. For example, on my development sites, I always add a must-use plugin to enable strict PHP error reporting. The content of this mu-plugin is very simple, just a file header comment and one line of code:

<?php 
/*
	Plugin Name: PHP - Strict Error Reporting
	Description: Enable strict error reporting for testing PHP.
*/
error_reporting(E_ALL | E_STRICT);

After adding your must-use plugin to the /wp-content/ directory, you can visit the Plugins screen in the Admin Area. It won’t be listed along with the regular plugins, but rather is given its own sub-screen as shown here:

From the Plugins screen, click the “Must-Use” link to view a list of active mu-plugins

That’s pretty much full story on must-use plugins. There are however some important things to keep in mind when deciding to use mu-plugins:

  • Mu-plugins must be single .php files, not stored in folders
  • There are no notifications for updates for must-use plugins
  • Activation hooks are not executed in the /mu-plugins/ folder
  • Must-use plugins are active and executed until removed
  • Must-use plugins run in alphabetical order before regular plugins

Pro Tip

To change the location of the must-use directory, you can add the following definitions to your site’s wp-config.php file. Then edit the definition values with the new directory location.

define('WPMU_PLUGIN_DIR', WP_CONTENT_DIR .'/mu-plugins');
define('WPMU_PLUGIN_URL', WP_CONTENT_URL .'/mu-plugins');

To learn more about must-use plugins, visit the official documentation at WordPress.org.

Drop-In Plugins

Perhaps the most unknown type of WordPress plugin is the “drop-in” plugin. Drop-in plugins enable developers to modify numerous core features by adding specifically named PHP files to a specific location in the WordPress directory structure. Drop-in plugins are not included with WordPress by default, but rather can be added as needed by developers and site administrators.

For example, I like to add a drop-in plugin to handle any database errors. This is done by adding a file named db-errors.php to the WordPress /wp-content/ directory. Here is a screenshot showing its location:

Screenshot showing the location of the db-error.php drop-in plugin inside the /wp-content/ folder
Note: Drop-in plugins are not included with default WordPress installations, but rather are added manually on an as-needed basis.

Currently WordPress supports 12 drop-in plugins. For a current list, crack open /wp-admin/includes/plugins.php in the WP core. There you will find a function named _get_dropins() that shows all supported drop-in plugins, the file name, description, and when they are loaded. Currently looks like this:

function _get_dropins() {
	$dropins = array(
		'advanced-cache.php'      => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ),  // WP_CACHE
		'db.php'                  => array( __( 'Custom database class.' ), true ),          // Auto on load.
		'db-error.php'            => array( __( 'Custom database error message.' ), true ),  // Auto on error.
		'install.php'             => array( __( 'Custom installation script.' ), true ),     // Auto on installation.
		'maintenance.php'         => array( __( 'Custom maintenance message.' ), true ),     // Auto on maintenance.
		'object-cache.php'        => array( __( 'External object cache.' ), true ),          // Auto on load.
		'php-error.php'           => array( __( 'Custom PHP error message.' ), true ),       // Auto on error.
		'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // Auto on error.
	);

	if ( is_multisite() ) {
		$dropins['sunrise.php']        = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE
		$dropins['blog-deleted.php']   = array( __( 'Custom site deleted message.' ), true );   // Auto on deleted blog.
		$dropins['blog-inactive.php']  = array( __( 'Custom site inactive message.' ), true );  // Auto on inactive blog.
		$dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // Auto on archived or spammed blog.
	}

	return $dropins;
}

So you can use that function as a reference to add your own drop-in plugins as needed. As mentioned above, all of these drop-in files must be located in the /wp-content/ directory in order to work. They will not work if placed in any other location. Also, the file names must be exact.

Tip: Just because you can modify functionality with drop-in plugins, doesn’t always mean you should. Use caution and do your research before making changes.

After adding your drop-in plugin(s) to the /wp-content/ directory, you can visit the Plugins screen in the Admin Area. It won’t be listed along with the regular plugins, but rather is given its own sub-screen as shown here:

From the Plugins screen, click the “Drop-in” link to view a list of active drop-in plugins

That’s pretty much full story on drop-in plugins. There are however some important things to keep in mind before adding your own:

  • The best way to learn more about drop-in plugins and how they work, is to search the WordPress core for “_get_dropins()”.
  • Drop-in plugins are loaded in the order provided by _get_dropins(), and before any regular plugins or must-use plugins.
  • Drop-in plugins must be named as defined in _get_dropins(), and must be located in the /wp-content/ directory.

Bonus: Theme functions

While not technically a type of plugin, the WordPress functions.php file provides yet another way to extend and customize any WordPress-powered site. The functions file can be added to any WordPress theme, whether Classic theme, Block theme, or Child theme. Here is a screenshot showing location:

Screenshot showing the location of the theme functions.php file

Inside the functions file, you can call core WordPress functions and define your own custom functions. To get an idea of the types of things commonly done with functions.php, check out these related posts here at DigWP.com:

Any function or code that can be added via regular plugin, also can be added via the theme functions.php file. There are however some important differences:

Code added via regular plugin

  • Requires specific header text in the main plugin file
  • Plugin files usually are included in their own directory
  • Located at /wp-content/plugins/your-plugin/
  • Can be managed via the Plugins screen in the Admin Area
  • When active, plugins are executed on every page load
  • Plugin functions always are applied to the current active theme
  • Usually each plugin focuses on one specific task or feature
  • Plugins hosted at WordPress.org can be automatically updated

Code added via theme functions

  • No specific header text required
  • Located at /wp-content/themes/your-theme/functions.php
  • Functions in functions.php are not displayed on the Plugins screen
  • Executed only when the functions file exists in the active theme
  • Theme functions apply only to the theme in which they are defined
  • May contain numerous functions and codes for different purposes
  • Theme functions are updated manually, or when the theme is updated

To learn more about theme functions, check out the following docs at WordPress.org:

So that’s all fine and good, but how do you know when to use a plugin and when to use theme functions.php? Let’s break it all down with a quick wrap-up summary..

Quick Summary

So when do you use regular plugins? Must-use? Drop-in? Theme functions? Here is a quick rundown of the four different methods:

Regular plugins

Usually the best way to customize WordPress. Plugins work across all themes, and can be managed and updated via the WordPress Admin Area. Plugins provide a very robust and flexible way to extend core WordPress functionality.

If in doubt, make it a plugin.

Must-use plugins

Must-use plugins are best used for adding functions that must take precedence over regular functions and theme functions. They usually serve very specific, singular purposes, like enabling strict error reporting. Must-use functions always run before regular plugins.

Drop-in plugins

Drop-in plugins are used to customize specific core features, like handling PHP and database errors. Drop-in plugins always run before regular plugins AND must-use plugins.

Theme functions

Theme functions are best suited for adding or modifying functionality that is specific to a specific theme. Any code or functions contained within a theme’s functions.php file will be executed only when the theme is active, and will not apply to any other themes. If that sounds like you, then theme functions are the way to go. Otherwise, to add functionality that applies for any/all themes, then go with a plugin is best.

⭐ That’s all folks! Let me know if I missed anything by leaving a comment below, thanks! :)

Leave a Reply

Required fields marked *. Email kept private. Basic markup allowed. By entering your data and submitting your comment, you agree to our Privacy Policy.

© 2009–2025 Digging Into WordPress Powered by WordPress Monzilla Media shapeSpace