What Is a Must-Use Plugin in WordPress (And How I Create One)

Gerry Manzari · March 30, 2026 · 2 min read

A must-use plugin (MU plugin) is a special type of WordPress plugin that loads automatically and cannot be disabled from the admin dashboard. I use these for core functionality that I never want accidentally turned off — things like custom code, performance tweaks, or essential features my site depends on. Since MU plugins load before regular plugins, they’re reliable and always active, which makes them perfect for keeping important logic in one place without relying on theme files or standard plugins.

To create one, go to the /wp-content/ directory and create a folder called mu-plugins (if it doesn’t already exist). Inside that folder, create a PHP file like manzari-core.php, add a standard plugin header at the top, and paste in my code. That’s it — WordPress will automatically load it on every request. No activation needed, and no risk of it being disabled.

Try Creating Your Own Must-Use Plugin

If you want to create your first must-use plugin, I recommend starting with something you’ll actually use. One of the most common limitations in WordPress is that it doesn’t allow SVG uploads by default. Instead of installing a plugin, you can enable this with a few lines of code and keep your site clean.

How to Create a Must-Use Plugin in WordPress

  • Go to your WordPress root directory
  • Open the wp-content folder
  • Check if a folder name mu-plugins exists
    • If not, create a new folder named mu-plugins (make sure the name is spelled exactly with the dash)
  • Inside that folder, create a new file called (i.e. svg-upload.php)
  • Paste the code (below) into that file, save it, and that’s it! You’ve successfully created your own must-use plugin 🙂 And, since it’s a must-use plugin, it runs automatically, so no activation is needed.
PHP
<?php
/**
 * Plugin Name: Manzari Core
 */

// Allow SVG uploads (admin only)
add_filter( 'upload_mimes', function( $mimes ) {
    if ( current_user_can( 'manage_options' ) ) {
        $mimes['svg']  = 'image/svg+xml';
        $mimes['svgz'] = 'image/svg+xml';
    }
    return $mimes;
});

// Fix SVG preview in media library
add_action( 'admin_head', function() {
    echo '<style>
        .attachment-266x266 img[src$=".svg"],
        img[src$=".svg"].thumbnail {
            width: 100% !important;
            height: auto !important;
        }
    </style>';
});