What Is a WordPress Must-Use Plugin?

Overview

A WordPress Must-Use (MU) plugin functions similarly to other WordPress plugins, with one distinct feature that sets it apart. Unlike regular plugins, it remains active if the directory wp-content/mu-plugins contains its file(s). Notably, it doesn’t appear in the WordPress backend and doesn’t receive automatic updates; manual updates are necessary. Additionally, Must-Use plugins load before standard ones, following alphabetical order.

Characteristics of Must-Use Plugins

  • Visibility: MU plugins do not appear in the WordPress admin dashboard.
  • Updates: They do not receive automatic updates.
  • Loading Order: Based on alphabetical order, MU plugins load before standard plugins.

Why Use Must-Use Plugins?

Whether to use MU plugins depends on individual preferences and specific use cases. They offer a solution if you require certain code to execute consistently. For further insights on this topic, refer to the official documentation.

How to Upload a Must-Use Plugin to Your Environment

Via SFTP

Login: Access your environment via SFTP.

Navigate: Go to ~/public/wp-content/mu-plugins.

Upload: Place your PHP file inside this directory. If the mu-plugins directory does not exist, create it by right-clicking and selecting “Create Directory”.

    Via SSH

    Login: Log into your environment via SSH.

      Navigate: Use a built-in text editor (e.g., nano) to add your MU plugin:

        nano ~/public/wp-content/mu-plugins/my-mu-plugin.php
        

        Add Code: Insert your code and save the file.

        Create Directory: If the mu-plugins directory does not exist, create it with:

        mkdir ~/public/wp-content/mu-plugins

        As always, if you have any additional questions, please don’t hesitate to contact our support chat at servebolt.com!