How to Create MU (Must Use) WordPress Plugin

| Last Updated: | In: Featured, WordPress, WordPress Beginners, WP Labs


Sometimes we need to create a MU plugin (Must Use) WordPress plugin in your WordPress based project. In this tutorial, I will explain How to Create MU (Must Use) WordPress Plugin.

WordPress mu-plugins

What is WordPress MU (Must USe) Plugin

WordPress MU Plugin is also known as Must-Use plugins, which are installed in a special directory inside the wp-content folder of your WordPress website. It is automatically enabled on all of your site in that installation. MU-Plugins are not listed in the default plugin lists in WordPress admin panel and It can’t be disabled until you have not remove the plugin from must use directory.

Benefits of MU-Plugin

Must-Use plugin have many features, Below is the some features of WordPress MU-Plugin:

  • AUtomatically enabled after uploading to the mu-plugins directory inside the wp-content folder.
  • Always activated, no need to enable it via wp-admin
  • It will loaded in alphabetical order, before the normal plugins.

How to Create a Must-Use Plugin

Let’s create a simple MU-Plugin. In this example, I will create a WordPress MU-Plugin with an example, so that it will help you to understand more.
Step 1) Go to the wp-content folder and create a mu-plugins folder like wp-content/mu-plugins.

How to Create MU (Must Use) WordPress Plugin

Step 2) Create a file named “hello-world.php” inside the mu-plugins folder.

Step 3) Now copy the below code and add inside the “hello-world.php” file.

After saved the file, it will automatically be enabled on your WordPress site and not listed inside the plugins list in Admin panel.

mu-plugins-list-1-1024x341

Over to You

Thank you for giving your time to the FreeWebMentor community. If you still need any help, feel free to add your comments in below comment section. I will be happy to help.

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials and also don’t forget to subscribe my blog to get all future tutorials directly in your mail box.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Tags: , , , , ,