October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Create and Install Must-Use Plugins in WordPress

Create the wp-content/mu-plugins folder, upload a top-level PHP file, verify it under Plugins > Must-Use, and manage removal through SFTP, SSH, or your host’s file manager.
WorldWordPress Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To install a WordPress must-use (MU) plugin, create wp-content/mu-plugins, place the plugin’s PHP file directly inside it, and load the site. WordPress loads top-level PHP files in that directory automatically, so there is no Activate button. This guide shows how to build the folder, install single- and multi-file plugins, verify loading, control load order, recover from errors, and remove an MU plugin safely.

What a must-use plugin is

A must-use plugin is a WordPress plugin that is loaded automatically from a special directory. It is intended for code that must run on every request and should not depend on an administrator remembering to activate it. Typical uses include enforcing site-wide settings, registering functionality for a managed installation, adding security or operational rules, and loading code that needs to run before ordinary plugins and themes.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress does not normally create the MU directory for a new site. You create it under wp-content. The conventional path is:

/wp-content/mu-plugins/

Any PHP file placed directly in that directory is loaded automatically. There is no activation step, and the administrator cannot deactivate it from the Plugins screen. The absence of an activation switch is the defining operational difference, not a special PHP language or a different plugin API.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Must-use, normal, and drop-in plugins compared

Type Usual location How it starts running Admin activation control Important limitation
Normal plugin wp-content/plugins Install, then activate it in WordPress Can be activated and deactivated in the dashboard Code that depends on activation hooks can run during activation
Must-use plugin wp-content/mu-plugins Automatically loaded when WordPress starts No Activate or Deactivate control Activation hooks do not run; file changes must be made on the server
Drop-in plugin Specific files in wp-content, such as object-cache.php WordPress detects a specially named replacement file Managed according to that drop-in’s behavior It replaces or extends a core subsystem rather than behaving like a normal plugin

Drop-ins and MU plugins are often mentioned together because both are loaded outside the ordinary activation workflow, but they are not interchangeable. A file named object-cache.php, for example, is a cache drop-in; putting an unrelated plugin in the wrong location will not convert it into a drop-in.

Before you create the directory

You need a way to edit the site’s files and enough access to write inside the WordPress installation. Use one of these methods:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • SFTP: connect with the host, port, username, password or key, and remote path supplied by your host.
  • SSH: connect to the server and use shell commands or an editor, provided your account can write to the WordPress directory.
  • Host file manager: use the file manager supplied by your hosting control panel.

Make a backup or commit the change to your deployment system before installing code that will run on every request. A PHP parse error in an MU plugin can affect the front end, the login page, and the administration area at the same time. Keep a copy of the original file so you can restore it quickly.

Confirm that you are editing the production site’s actual WordPress root. The root contains files such as wp-config.php, wp-admin, wp-includes, and wp-content. Creating mu-plugins beside, rather than inside, wp-content will not work unless the site has deliberately configured a custom directory.

Create the standard mu-plugins directory

On a self-managed WordPress installation, follow these steps:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
  1. Connect to the site over SFTP, SSH, or the host’s file manager.
  2. Open the WordPress installation’s wp-content directory.
  3. Create a new directory named exactly mu-plugins. Use lowercase letters and the hyphen shown; do not name it mu_plugins, must-use, or must-use-plugins.
  4. Confirm the resulting path is /wp-content/mu-plugins/.
  5. Upload the MU plugin’s PHP file directly into that directory.

The directory may be empty until you add a file. Its absence on a new WordPress site is normal; creating it is part of the installation process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install a single-file MU plugin

A single-file plugin is the simplest arrangement. If the file is called my-plugin.php, upload it to:

/wp-content/mu-plugins/my-plugin.php

A minimal file can contain a plugin header and ordinary WordPress hooks:

<?php
/**
 * Plugin Name: Site Rules
 */

add_action('init', function () {
    // Site-wide code goes here.
});

The header is useful for identifying the file in the dashboard, but it does not create an activation workflow. WordPress scans the MU directory and loads the PHP file automatically. Do not wrap the code in an activation callback and expect that callback to fire: activation hooks do not run for MU plugins.

After uploading, load a page on the site and then open the WordPress dashboard. Go to Plugins and open the Must-Use tab. The file should be listed there. Seeing it in that tab confirms that WordPress recognized the file as an MU plugin; it does not mean that the plugin can be activated or deactivated from that screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Install a multi-file MU plugin with a loader

WordPress loads PHP files that are directly inside mu-plugins. It does not automatically scan nested directories. For a plugin with classes, templates, and several source files, put the implementation in a subdirectory and add one top-level loader file.

For example, use this structure:

wp-content/
└── mu-plugins/
    ├── my-plugin-loader.php
    └── my-plugin/
        ├── plugin.php
        ├── includes/
        │   └── class-rules.php
        └── assets/
            └── settings.json

The top-level loader is the file WordPress sees. It can load the real plugin file with an absolute path based on the loader’s directory:

<?php
/**
 * Plugin Name: Site Rules Loader
 */

require_once __DIR__ . '/my-plugin/plugin.php';

Inside plugin.php, use paths relative to that file or define a base directory before requiring additional files. A loader prevents the common mistake of uploading only a subdirectory and then wondering why nothing appears in the Must-Use list. The loader itself must end in .php and must sit directly in mu-plugins.

Keep non-PHP assets, documentation, and tests in subdirectories. A PHP file left at the top level will be loaded on every request, even if it was intended only as a helper. If a helper is not meant to execute independently, keep it below the top level and require it from the loader.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How WordPress loads MU plugins

Top-level files only

WordPress loads PHP files in the first level of the MU directory. It does not recursively discover every PHP file below it. This is why a multi-file plugin needs a top-level loader.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Alphabetical order

Files are loaded alphabetically. If one MU file must be initialized before another, teams commonly prefix filenames with numbers such as 00-bootstrap.php and 10-rules.php. Prefixes are a practical convention, not a documented requirement that guarantees a particular application architecture. Prefer explicit dependencies and a single loader when ordering is important.

Earlier than ordinary plugins and themes

MU plugins load before regular plugins and themes. That makes them suitable for policies or filters that must exist before another component initializes, but it also means a mistake can prevent later code from loading normally.

Every request

Every top-level PHP file is included on every WordPress request. Keep the code efficient, avoid expensive work that does not need to happen on every request, and use normal WordPress APIs rather than editing core files. A fatal error, syntax error, or incompatible function call can break the entire site rather than only one optional feature.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to verify that an MU plugin works

  1. Check the remote path and confirm that the file is in wp-content/mu-plugins, not in wp-content/plugins or a nested directory without a loader.
  2. Open the file and confirm it has valid PHP syntax and begins with <?php. Do not add a closing PHP tag unless the project specifically requires one.
  3. Visit the site once to make WordPress load the file.
  4. In the dashboard, open Plugins > Must-Use. Confirm the expected name and file are listed.
  5. Test the behavior the plugin is intended to provide, including an administrator request and a logged-out request if both paths matter.
  6. Review the PHP error log and the WordPress debug log for parse errors, missing files, undefined functions, or permission failures.

A plugin can appear in the Must-Use list and still contain logic that never runs because its hook is wrong, a condition is false, or a required file path is incorrect. The list verifies discovery, not the correctness of every code path.

How to disable or remove a must-use plugin

There is no Deactivate button for an MU plugin. Disable it from the server:

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
  1. Connect with SFTP, SSH, or the host’s file manager.
  2. Open wp-content/mu-plugins, or the host-defined MU directory.
  3. Rename the file so it no longer has a PHP extension, for example my-plugin.php.disabled, or move it outside the MU directory.
  4. Load the site and verify that the problem or behavior is gone.
  5. Delete the file only after you have preserved a backup or confirmed it is no longer needed.

Renaming is safer than deleting during troubleshooting because it gives you an immediate rollback. For a multi-file plugin, rename or move the top-level loader; leaving the loader active will continue to require the subfolder. If the loader itself is healthy but one implementation file is broken, restore the known-good file or temporarily move the entire plugin directory as well.

Recovering from a fatal error

If the site returns a blank page, a critical-error screen, or a server error immediately after installation, use SFTP, SSH, or the host file manager rather than the WordPress dashboard. Rename the suspected top-level MU file, then retry the front end and login page. If the site recovers, inspect the PHP log, correct the code, and upload a tested replacement. Do not repeatedly refresh a broken production site while experimenting; each request executes the faulty file again.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Host-managed and custom MU directories

The standard path is the right starting point for a normal WordPress installation, but managed hosts can provide their own arrangement. Some platforms install a host-owned MU plugin, and some reserve a separate directory for customer code. WordPress VIP documentation, for example, describes a /client-mu-plugins directory at the root of the site’s code repository rather than the conventional wp-content/mu-plugins path. A host may also add its own MU plugin for caching, monitoring, or platform integration.

The location can be changed with the WPMU_PLUGIN_DIR constant in wp-config.php. Before creating a second directory, inspect the configuration and follow the host’s deployment documentation. A custom path takes precedence over the conventional one for that site; uploading to the wrong directory will make the file appear to be missing.

Some hosts restrict direct writes to production or deploy MU plugins from version control. In that situation, use the host’s documented repository, deployment command, or support workflow instead of forcing a manual upload. Do not delete a host-supplied MU plugin merely because you did not create it; first identify what service depends on it.

Troubleshooting: when an MU plugin is not showing

Symptom Likely cause What to check
The Must-Use tab is empty The directory does not exist, is in the wrong WordPress installation, or a custom path is configured Confirm the site root, inspect wp-content, and check WPMU_PLUGIN_DIR and host instructions
The file exists but is not listed It is nested below the first level, has the wrong extension, or permissions prevent reading it Move the PHP file directly into the MU directory, check the filename, and verify ownership and read permissions
A multi-file plugin does not load Only the subfolder was uploaded; no top-level loader requires the main file Add a loader such as my-plugin-loader.php and use a correct require_once path
The site breaks after upload PHP syntax error, missing include, incompatible code, or an unhandled runtime error Rename the top-level file to disable it, read the PHP/WordPress log, and restore a known-good version
The plugin appears but expected behavior is absent The code depends on an activation hook, runs on a different hook, or its condition is not met Move initialization into a normal runtime hook, test the relevant request type, and inspect logs
Renaming one file changes nothing A loader or duplicate copy is still active Search the MU directory and configured custom path for another top-level PHP file or loader

Operational practices for reliable MU plugins

  • Use version control: store the loader and implementation files in the same repository as the site’s deployment code when possible.
  • Make changes reversible: deploy a new filename or keep the previous release so a rename or rollback can disable the change quickly.
  • Keep one clear entry point: a single loader reduces accidental execution of helper files and makes load order easier to understand.
  • Document ownership: record who maintains the file, what it does, and which host or service depends on it. An MU plugin may be invisible to a developer who only checks ordinary plugins.
  • Test before production: check front-end pages, login, administration, cron jobs, REST requests, and command-line tasks that the code affects.
  • Avoid activation assumptions: perform migrations or one-time setup through an explicit, repeatable routine rather than an activation hook that will never fire.
  • Review permissions: the web server must be able to read the files, but write access should be limited to the deployment or administrator account.
  • Watch compatibility: because MU plugins load before other extensions, use defensive checks when calling functions supplied by another plugin and fail gracefully when that dependency is absent.

When an MU plugin is the right choice

Choose an MU plugin when the code must be present on every request, should not be switched off by an ordinary dashboard user, or belongs to the site’s platform configuration rather than to an optional feature. It is also useful when a deployment process should make the code available immediately without a separate activation click.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a normal plugin when administrators need ordinary activation and deactivation, when the plugin is optional, or when its installation process relies on activation hooks. A normal plugin also fits projects that expect WordPress’s standard update and administration screens.

Do not use an MU plugin simply to hide a poorly maintained plugin from the Plugins page. Automatic loading increases the impact of defects and makes emergency access depend on server-level file access. Treat every MU file as production infrastructure: review it, test it, track it, and keep a recovery path.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.