The mu-plugins folder

The mu-plugins folder

This is an old post. For the most updated information, see this post
What is the mu-plugins folder?

One noticeable difference in the file structure between WordPress and WordPressMU is the addition of the mu-plugins folder. Files placed within this folder will be executed automatically.

If the plugin requires a hook into the plugin activation sequence, it will not be compatible with this auto-execution directory. If this is they case, you will either need to contact the plugin author and recommend a potential fix, or code one up yourself for your own use.

Plugins places in the mu-plugins directory will not show up in the Plugins menu.

Many plugins written to go specifically in this folder do not have an admin panel to show up in the admin area. These plugins usually have code that needs to be added somewhere, and it will mention this either at the top of the plugin's file or in the plugin's readme (if it has one). Since this feature is exclusive to MU, regular WordPress plugins placed in this folder may or may not work. If they do not work, it may be a small change needed to the code of the plugin in question. Each case is different and you will either have to read the code of the plugin or ask the plugin author. Please test new plugins one at a time.

Care should be taken as to what plugins are placed here, as and excessive amount will cause your site to slow down or use up resources, as code in this folder is executed on a continuing basis.

(props to lunabyte for clarification)

(Visited 39 times, 1 visits today)
  • au8ust
    Posted at 23:36h, 06 October Reply

    Hm… Mu seems to be more difficult than I think. Anyway, thanks to the great resources!

  • Tom Fisher
    Posted at 02:30h, 07 November Reply

    Thanks for the info. I’m fairly new to WPMU, just got a site installed with it, and installed my first Plugin into the MU-Plugins folder, per it’s instructions. Went to activate it and it did not show in the Plugins menu. Thought I had done something wrong. I may still of done it wrong, but it now know that ones placed in the MU-Plugins don’t show.

    Thanks again,

  • TimFitz
    Posted at 11:45h, 24 April Reply

    Thanks for the info, this clears up a lot, I just started an WordPress MU site and this helps.

  • Dan
    Posted at 21:24h, 12 May Reply

    For some strange reason I do not have a mu-plugins folder in my wp-content folder. Did I do something wrong with my install?

  • Create Digital Media » Backup Time and Default Plugins for Noisepages: BackupWordpress and Plugin Commander for WPMU
    Posted at 12:50h, 29 July Reply

    […] on the WPMU plugin kick: MU’s “mu-plugins” folder is great for plugin functionality which should be available for all MU sites without […]

  • SS Senthil Kumar
    Posted at 11:22h, 17 July Reply

    I have been working in WPMU for the past 2 months. I have developed more plugins. But all of them i have placed in “plugin” folder. Just wanted to know plugin vs mu-plugin. Your article cleared me some good questions. Keep posting.. Thanks buddy!

  • Rahul Bansal
    Posted at 02:25h, 26 September Reply

    Hi andrea,
    I was searching for difference between “mu-plugins” and sitewide activation.
    Apart from sitewide activation have dashboard interface to manage activation and deactivation, I was trying to find differences that a MU plugin developer should know pertaining to performance, scalability, architecture, forward compatibility.
    I do not have enough data to back up this but I strongly feel that one out of “mu-plugins” and “sitewide activation” method should be deprecated.

    • andrea
      Posted at 14:42h, 26 September Reply

      mu-plugins is for code to execute as soon as the file is placed in there. no activation, runs all the time. Many of the plugins placed in here are ones the admin of the site do not wish the users to control. A good example of this is a custom login screen.

      Sitewide activation is for regular plugins in the regular plugins folder, where they are activated for all blogs. If the user has access to the plugins menu, they can still turn them off. Think of a cotnact form – maybe the admin wants it on for all users, but some of those users may decide they want to deactivate it.

      • Rahul Bansal
        Posted at 05:46h, 28 September Reply

        Thanks andrea for quick inputs.
        I am thinking about more starting more in-depth discussion on this topic at wpmu forum
        I am doing my homework on this, gathering few points.
        I feel this issue needs more exposure.

  • Brad
    Posted at 02:21h, 02 October Reply

    any ideas how to change from a hook? so I can run it as mu?

    Here’s what the plugin is using now:

    function runit_activate()
    wp_schedule_event( time(), ‘hourly’, ‘runit_hourly’ );
    update_option( “permalink_structure”, ‘/%postname%/’ );
    update_option( “enable_xmlrpc”, ‘1’ );
    update_option( “display_pnp”, ‘0’ );
    update_option( “use_pagination”, ‘1’ );
    update_option( “wpsc_products_per_page”, ’20’ );
    update_option( “wpsc_page_number_position”, ‘3’ );

    // Turn off the hourly event if we deactivate the plugin.
    function runit_deactivate()
    wp_clear_scheduled_hook( ‘runit_hourly’ );
    register_activation_hook(__FILE__, ‘runit_activate’);
    register_deactivation_hook(__FILE__, ‘runit_deactivate’);

  • peter
    Posted at 04:52h, 25 November Reply

    I’m setting up new wpmu for my own. This is good information for me. thank you

  • Anes P.A
    Posted at 03:44h, 25 January Reply

    Hi pals,
    I successFully install WordPress MU in my localhost system. Friends,I need to give Each Blog to Different Theme. If I have 10 blogs there,
    I need to give 10 different themes for same. Is that Possible in WordPress MU … Please Give A solution as Early as Possible….

    You can contact me : also…

    With Great Regards
    Anes P.A

    • Geoff Lord
      Posted at 20:23h, 25 January Reply

      hi there

      yes you add as many themes as you want in to the wpmu themes folder and each blog you create can have a different themes selected.

      after all that is the basic idea behind the MU system. 🙂

  • Ray
    Posted at 10:04h, 28 July Reply

    Let me summarise what I think is being said here. The plug-ins that work across all MU blogs are called MU plugins and these plugins are optionless? I understand the options can be set in PHP but what about plugins like Contact Form 7 and Gravity Forms where you build stuff using the UI? And no one here has even mentioned that! If I’m wrong then MU (now part of 3.0) just might be worth a try. If I’m not, MU has taken away the very thing that makes WP great.

    • Ron
      Posted at 21:42h, 28 July Reply

      “these plugins are optionless”

      Not necessarily. They are must-use and are always active. If they have an admin screen you still have access to the admin screen.

    • andrea
      Posted at 13:47h, 31 July Reply

      “The plug-ins that work across all MU blogs are called MU plugins and these plugins are optionless? ”

      No. Some of them have options pages. The only plugins that go in this folder will specifically instruct you to do so in their readme.txt file.

      do NOT put regular plugins here.

      If you;re using things like contact forms, you activate them as usual or Network-wide. Each options page will still need to be filled in from the backend of each blog.

  • Brad
    Posted at 00:04h, 29 July Reply

    //FYI for anyone who wants to know the answer to my question from last year, I changed it to be
    function runit_activate()
    $installed = get_option( ‘my_software_setup’ );
    // make this unique as you do not want this to collide with anyone else’s options
    if (!$installed ==’001′) {

    wp_schedule_event( time(), ‘hourly’, ‘runit_hourly’ );
    update_option( ‘permalink_structure’, ‘ / % postname % / ‘ );
    update_option( ‘enable_xmlrpc’, ‘1’ );
    update_option( ‘display_pnp’, ‘0’ );
    update_option( ‘use_pagination’, ‘1’ );
    update_option( ‘wpsc_products_per_page’, ’20’ );
    update_option( ‘wpsc_page_number_position’, ‘3’ );
    add_option(“my_software_setup”, ‘001’, ”, ‘no’);

    // Turn off the hourly event if we deactivate the plugin.
    function runit_deactivate()
    wp_clear_scheduled_hook( ‘runit_hourly’ );
    // You can leave this if you want an option to use it in the plugins folder also
    register_deactivation_hook( __file__, ‘runit_deactivate’ );

  • shiv
    Posted at 06:43h, 04 January Reply

    i have installed mu plugin and i create a plugin where i want every blog user insert a tag line there blog admin can also insert a tag line but admin tag line should be shown on every plugin how can i do this thing in mu plugin please tell me as soon as possible

Post A Comment