141 Responses

  1. Andrea_R
    Andrea_R Published |

    “it’s a bit of a hidden gem that I wish more folks knew about”

    Me too! +1000 for this. It’s a handy thing.

    Also! For those devs worried about clients disabling plugin on them – the use of this folder prevents that. 😉

    1. Chunlin
      Chunlin Published |

      This is a really good way to tweak functions.php file, thanks for sharing!

  2. Michael Martin
    Michael Martin Published |

    Great post Justin! Had no idea about the mu-plugins folder. I’d seen it before with WPMU installs but no idea the mu stood for something totally different. Very handy trick, especially for making sure clients can’t deactivate something important on their site, thanks!

  3. Anthony
    Anthony Published |

    So cool, I haven’t ear about mu-plugin folder before reading this here, thanks !

  4. Todd J. List
    Todd J. List Published |

    I like this idea. A LOT. I appreciate the tip about adding the must-use plugins folder, too. Thank you!

  5. Bronson Quick
    Bronson Quick Published |

    Wow, here I was thinking that the mu-plugins folder only applied to multisite sites. That’s the best WordPress tip I’ve learnt in ages. Thanks for the post Justin!

  6. Pippin Williamson
    Pippin Williamson Published |

    As with others, I had no idea that MU stood for must-use, instead of WPMU.

    Great ideas.

  7. James
    James Published |

    Great tip. I can see how this would be very handy. I like the MU folder option too. Is this all that needs to be done for it to work or does some code need to be entered in the regular functions.php file to call the custom functions?

  8. pcaWeb
    pcaWeb Published |

    Like others who have commented, I too had no idea about the “must use” plugin dir.

    It would be interesting to see the code you have in yours – ever considered putting it up for us to look at?

    Thanks for the post.

  9. Markus
    Markus Published |

    great idea 😉

  10. serge
    serge Published |

    I was still using the my-hacks file (I know it’s deprecated). I change now. Thanks for this tips.

  11. paul
    paul Published |

    this is very cool indeed. thanks for the tips.
    so if it’s in the mu folder, there is no disable / delete link?
    what if I modify an existing plugin and don’t want the client to update it, can I put it there instead of using this :

  12. Gumz
    Gumz Published |

    First time to hear… Again, from you… 🙂

  13. Steve Taylor
    Steve Taylor Published |

    Ditto on the coolness of learning about mu-plugins!

    One thing is that my thinking about custom code kind of goes the other way round. I think, “If this code is portable, and I could use it on other sites, then [ideally!] I’ll make it into a plugin.” But stuff like custom post types and taxonomies – unless, of course, you’re creating a fully-fledged “management” plugin with a UI – is surely site-specific, and therefore is best as part of the theme’s functions.php.

    Of course, I’m thinking here of the bulk of my clients, who get me to create a completely custom theme for them. And of course, there’s nothing necessarily bad against creating plugins just for one site…

  14. Randy
    Randy Published |

    I can’t believe I have been creating themes this long and had no idea this folder could be created. Thanks a million!

    Q: If you place a public plugin, like from the wp directory, will wp still notify when updates are needed? Or is it best to only use your own “custom” functions in the mu folder?

    1. Simon
      Simon Published |

      Try here: http://w-shadow.com/blog/2010/09/02/automatic-updates-for-any-plugin/

      I have been chucking all my useful functions into a plugin file regularly for a couple years now.

      Good post!

  15. Damon
    Damon Published |

    Great tip, and will definitely be using. I’m an old Mu user, and never even thought of this, but didn’t realize you could use on single install too. Kudos!!

  16. Simon B
    Simon B Published |

    One important thing to note is that unlike the normal plugins folder, you cannot place must-use plugins in a subfolder. They have to be directly in the mu-plugins folder, or they will not work or show up in the plugins list.

    There are also a couple of handy constants available for use in your must-use plugins: WPMU_PLUGIN_DIR and WPMU_PLUGIN_URL.

    1. Joshua Guffey
      Joshua Guffey Published |

      Thanks Simon! I forgot about the sub-folders. you may have just saved me a headache. -J

  17. Adam W. Warner
    Adam W. Warner Published |

    A very timely post Justin. I was just at WordCamp Phoenix and attended a session about the creation and use of Custom Post Types. I asked if there were plugins that could be used to create and manage CPTs (and Custom Meta Boxes) and was told about one created by Brad Williams…but I was strongly encouraged to NOT use a plugin for CPTs.

    I’m very familiar with adding functions to my functions.php file, and making these into a portable plugin I can use seems like a good comprimise.

    Thanks for writing this up!

    ***feature creep*** – Do you think it would be a valid idea to take this further and create a GUI for people to either write or paste in their custom functions? Then output a list of all the functions to the admin and give them the option to turn them on and off?

  18. Scott
    Scott Published |

    Woohoo, a hidden gem indeed!

    Thanks Justin.

  19. Jamal Mohamed
    Jamal Mohamed Published |

    I already knew about drop-ins and I’ve used it for a couple of clients’ sites, but MU’s were “multi-user” to me until today 😉

    A good idea when you design a site for a half-tech-half-noob client.

  20. Richard Vencu
    Richard Vencu Published |

    Hi, nice tip. What hook should we use here to call our functions? They are not anymore theme related so maybe there is no need to wait for ‘after_setup_theme’?

  21. Richard Vencu
    Richard Vencu Published |

    Right. Maybe you can recommend some resources to understand how to choose the proper hook depending on the plugin function.

    I found out that I need to split what I put in the theme’s `function.php` file into several of those plugins for the sake of consistency and reusability, and they deal with some custom post types, some frontend editor, a points based rewarding system and some extended user management functions (additional metadata definition, etc).

  22. Joshua Guffey
    Joshua Guffey Published |

    Thanks Justin. This is deceptively simple. I’ve been thinking for some time (as I’m sure others have) about how to do this in a ‘clean’ fashion. This is just perfect. And again, deceptively simple. Thanks for pointing it out!

    -Joshua Guffey

  23. Renji Thomas
    Renji Thomas Published |

    Didn’t know that mu-plugins folder works with single site too. Thanks for the post Justin! 🙂

  24. Another Cool Way to Keep WordPress Functions Organized and Portable! - VoodooPress
  25. Ryan
    Ryan Published |

    I ended up doing this after some comments from Otto quite a while back. He was suggesting creating a series of itty bitty plugins for each little thing that you need, that way it’s simply a matter of copying the individual plugins you need over to any other sites you may be working on. This has now resulted in me having dozens of tiny plugins running on my sites, but it’s pretty handy having all that code extracted out of a single chunk of code so that I can easily migrate them elsewhere when I need to. It doesn’t work so well on clients sites though as it’s a bit confusing having so many different (and usually poorly documented) plugins scattered around their install, so I still tend to use functions.php in that situation.

  26. Stu
    Stu Published |

    I’ve been doing this for a while. I was always wondering if it was a good idea or not. Now I am much more confident in my approach! I think using the theme functions.php file for anything other than appearance related features is a very bad idea.

  27. Jennifer
    Jennifer Published |

    Good article. I have a question. Do you know of a WP plug-in that will tell me how many hits a post gets on a blog?

  28. WordPress Community links: Found by WordPress edition | WPCandy
  29. Linda moo
    Linda moo Published |


    please could you tell me could we modify complete wordpress, each and every themes will change to custom template and all files rename and it will looks custom developed script.

    can we do this ???? and is it possible.



  30. Amy Hendrix
    Amy Hendrix Published |

    Like (apparently) a lot of folks, I knew mu-plugins from multisites, but had no idea that it could be used the same way for single installs. Adding it to the bag of tricks – thanks!

  31. danon
    danon Published |

    You make a great point about the functions.php file. All too often some developers use that file in the theme to make major changes to the site and starts to get some sloppy nested loops or calls and slows down the entire site. This is a great way to handle some updating problems. Thanks

  32. Marlon
    Marlon Published |

    Usefulness, thanks!

  33. paul
    paul Published |

    I’m using it now to hide dashboard widgets and hide menus from the client, so they don’t break their site 🙂

  34. Gary Taylor
    Gary Taylor Published |

    Brilliant. I’d already moved the functions in one site’s functions.php to a plugin file (the Family Tree web site which your custom taxonomies/post types tutorials have already helped with) because I use a different template for mobile visitors but the mu-plugins directory could come in very handy with clients who insist on having admin rights… I can just hide the plugins somewhere where they can’t delete them :->

  35. Jean
    Jean Published |

    Nice stuff! Are there any advantages of using this approach versus building a custom framework and including it via the functions.php, similar to what we do with Hybrid Core?

  36. kevin
    kevin Published |

    Very slick Justin, never even thought about using /mu-plugins – for non multi-site.
    Great article.

  37. Mahmudur
    Mahmudur Published |

    Great post Justin. Thanks a lot.

    NB: I haven’t find any share button in this page to share this article.

  38. Enrique Medina | Mexican Pottery

    Good information. Two years ago i try fix my own blog, but i do something wrong and die!

    Now leave that job to a programmer.

  39. Robert
    Robert Published |

    Thanks for the excellent mu-plugin tip!

    I’ve been looking for a way to accomplish this very thing, and your insightful tip has provided me the solution that I was looking for.

  40. Hitesh Bhasin
    Hitesh Bhasin Published |

    @ Justin – this is probably a wrong place to write this. But u are amazing. I have found ur presence across the internet on various places. Really respect your designing abilities. 🙂

  41. russ weaver
    russ weaver Published |

    i have also come across some of these problems when editing themes iam going to use you method for custom plugins

  42. mua sam vui
    mua sam vui Published |

    thanks ! i think with wordpress we jusst need a function file to do all of theme !

  43. Steph Chasen
    Steph Chasen Published |

    That is awesome… Thanks for the tips… Very helpful indeed! It’s worth the read!

  44. Eka Putra
    Eka Putra Published |

    Wow, it’s shocking.. its the first time I read about it, I did never know this WordPress hidden treasure are exists.

    Thanks for the great tips..

  45. Sharma
    Sharma Published |

    Helpful tutorial. I want to create my own custom plugins for social bookmarking sidebar widget. And now I can do it with the help of this article. Will share my custom plugin soon. So, Thanks a lot.

  46. Uncluttering the post editing screen in WordPress
  47. Ivan
    Ivan Published |

    Once I tried to do this, and failed. It seemed logical to me that custom post types and other non-theme options should go into file that has nothing to do with theme. So I created plugin and something went wrong. So, I believed that that is impossible to do. Thanks for this, I have just made what I wanted a year ago 🙂

  48. Terry Sutton
    Terry Sutton Published |

    Fantastic post.

    Please keep up the great work you do. I’ve referred back to your posts dozens of times in the past few months.


  49. Tali
    Tali Published |

    Hey Justin,

    Thanks a lot. This was an awesome tutorial. Bookmark and Subscribe 🙂

  50. Torben
    Torben Published |

    Never heard of the must use fuctionality before but I’m going to try it out.

  51. Lee
    Lee Published |

    Fantastic. This has saved writing Child themes for those sites that only required a change or addition to the functions.php file.
    Thank you!

  52. Dave
    Dave Published |


    Thanks for posting this. I didn’t know this existed. This is great for automating WordPress installs that use custom plugins for branded CMS purposes.

  53. Land-of-web » Get started with writing plugin for wordpress (35 useful tutorials)
  54. Discoveries of the Week #7 | Bradley Durham Designs
  55. How To Build A Media Site On WordPress (Part 1) - Smashing Magazine
  56. David Cox
    David Cox Published |

    Great if you have control of the theme, but you would need to be careful for distributed themes.

    If the file called a function on load from a theme or a plugin, the developer did not code to see if it existed and escaped, and the theme or plugin was disabled would this be a fatal admin lockout?

    What I do at the moment with 2010 child themes is have a folder of smaller function files to be included, and have a function in functions.php to read all files in the folder onload.

    So I have, category-functions.php, meta-functions.php, facebook-functions.php, post-functions.php with a few theme specific calls in each, it is very easy to manage, I add one function in functions.php and it reads any file in the folder in.

    Thinking about it, it could be nice if WordPress looked for a ‘theme-mu’ folder and loaded any files into functions.php on run.

    This would mean functions could be split out into smaller targetted different functions files by developers.


  57. Creating a custom functions plugin for end users | UnHack WP
  58. Offering Support is not Always Easy - Tweaker Themes
  59. Pieter
    Pieter Published |

    Great tip. I’ve never heard about the mu-folder. From this day on, things will change! 🙂 Thanks.

  60. Should Custom Post Types live outside of themes? | themesforge.com - Wordpress Themes, Tutorials, News, Tips and More
  61. A Free wordpress newsletter » 20 Really Handy Tutorials to help you build WordPress Plugins
  62. SarDira
    SarDira Published |

    Never in 1000 years I would have thought that mu stands for MustUse!!

    Thanks so much, you’ve changed my life forever!

  63. How to Incorporate Humans.txt into Your WordPress Site | Bitmag
  64. How to Incorporate Humans.txt into Your WordPress Site | WebDesign Terminal
  65. Bookmarks for January 29th through January 30th | dekay.org
  66. McBart
    McBart Published |

    Very useful tip. This makes adding code even more confinement.

    You can just upload the custom code plugin the normal way via wordpress plugin upload function, test it and when all is well, move it to the mu-plugin folder.

    Thanks for this very well done tip!

  67. Chris
    Chris Published |

    Your info about the mu-plugins folder is the useful tip on WP useage I have seen in ages. Thanks mate.

  68. Pete
    Pete Published |

    Nice… I’ll use this

  69. How to Incorporate Humans.txt into Your WordPress Site | Blog
  70. Daniel McClure
    Daniel McClure Published |

    I’ve seen the mu-plugins folder before but didn’t realise that it stood for must use! Thanks for sharing this information, will definitely be putting it to use for my functionality plugins in future.

  71. Brandon
    Brandon Published |

    Man this rocks, thanks Justin!
    It sure makes migrating function from theme to theme without adding too much to each functions file.

  72. 16 Helpful Tutorials for Creating WordPress Plugins
  73. Post format plural strings
    Post format plural strings at |
  74. Custom URLs for post formats
    Custom URLs for post formats at |
  75. rohit
    rohit Published |

    i saw this code but didn’t knew what it was… thanks !

  76. Mark from Germany
    Mark from Germany Published |

    Great. It works. And it is extremy useful.
    “mu-plugins” will be my favorite folder! 😉

  77. Stephanie
    Stephanie Published |

    Hi Justin,

    Great advice on making custom modifications! I recently downloaded your feature a page widget and got into the read me file to make the “read more…” mod and haven’t been able to succeed. I’m not sure if it’s due to the theme I’m using, Suffusion. I initially updated the functions.php with no luck and then created the mu-plugins folder per this post with the my-custom-functions.php from the code in the read me doc of the plugin and still no luck. Just wondering if you could point me in the right direction :o)


  78. How To Build A Media Site On WordPress (Part 1) | WordPress Planet
  79. Must Use Plugins VS functions.php | World WordPress
  80. Den
    Den Published |

    Thank you! Been using WP for years and Thesis “custom-function.php” but moving away from that to our own in-house framework. This is perfect!

  81. 30 Useful Tutorials to Create WordPress Plugin | Doublemesh
  82. Create Functions file plugin for WordPress
  83. Ray
    Ray Published |

    I have tried both methods, both report the same errors

    “The plugin generated 674 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin”

    any ideas, what have I don’t wrong?

    1. Ray
      Ray Published |

      oops, It’s OK error in copy & paste, doh!

  84. How to change your author archive link
    How to change your author archive link at |
  85. Simplifying 'My Sites' toolbar menu in WordPress multisite / WP Journo: WordPress & Journalism
  86. Top 160 Tutoriais WordPress – incluindo Basico, Desenvolvimento e Plugins – Site para Empresas – Blog sobre Internet e Criação de Site
  87. Globally Edit Dashboard CSS in WordPress Multisite - Shane Gowland
  88. Sinan Atici
    Sinan Atici Published |

    Actually I was looking for how to create custom post types. And now I got what is mu-plugins means. Its better using a plugin when creating custom post types than functions.php. I decided to make a plugin (mu-plugins). I asked what if I want to use an another theme? Better way is letting to hold the daha custom post type plugin…

  89. Separate theme display and functionality with a build-your-own custom functionality plugin | WordPress Snippets
  90. Kassiah
    Kassiah Published |

    Thanks so much for this awesome tutorial. I can’t wait to try it out.

  91. Globally Edit Dashboard CSS in WordPress Multisite - The Web Atom
  92. Where to put your custom WordPress functions | brettrawlins.com
  93. Ashish Chandra
    Ashish Chandra Published |

    Mind blowing article, Justin. You are the man. I have never heard about mu-plugins folder before. A must-see article for everyone having a blog.

  94. Creating a custom function plugin - Arctic WebSolutions
  95. Saku Mättö
    Saku Mättö Published |

    Hi Justin,

    I’ve been using this tip of yours very successfully, thanks a lot. Now, however I ran into a snag.

    I want to replace the Genesis 404 with a Finnish language 404 and other custom stuff. I placed my code into the mu subdir as normally, but with the genesis(); call at the end I get an error and with that removed I get the custom 404 AND the Genesis 404.

    Also, I’m not sure should I remove

    remove_action( 'genesis_loop', 'genesis_do_loop' );


    remove_action( 'genesis_loop', 'genesis_404' );

    Do you have a quick solution I might try?



  96. Wordpress Top 160 Tutoriais | Blog do Dinheiro Brazil
  97. How To Build A Media Site On WordPress (Part 1) | Smashing WordPress
  98. Ed Watson
    Ed Watson Published |

    Works like a charm. Thanks!!!!!!!

  99. How to Create a Custom Functions Plugin for WordPress - BytesWire
  100. Things learned while building a hosted Web Forum service with WordPress Multisite - The Web Atom
  101. How to hide the main site in the "My Sites" admin menu (Multisite) | BP-Tricks
  102. Experimenting with HTML5 image markup in WordPress - Synapticism
  103. Experimenting with HTML5 image markup and shortcodes in WordPress - Synapticism
  104. 30 Useful Tutorials to Create WordPress Plugin
  105. รวมสุดยอดสอนแต่ง WordPress ขั้นเทพ | HopeApps.com
  106. Steve
    Steve Published |

    Thanks very much for posting this, its a hidden gem. I am very glad I stumbled upon it.

  107. Functions File Explained | COMP 1920
  108. The WordPress mu-plugins folder | rebdev
  109. jenny
    jenny Published |

    I never even knew this was possible, and learning it just saved my hide, 3 years after you posted it. Thanks!

  110. James
    James Published |

    Just adding my own 2¢ of thanks for your post, Justin.

    2am bacon saver.

    There’s now a plugin on WP called “my-custom-functions”

    which allows for the functionality you same described…

    … ‘cept by my reading believe the author’s put safeguards in re self-harm of getting it wrong.

    Thanks again Justin 🙂

  111. Lord Gareth Lloyd
    Lord Gareth Lloyd Published |

    Thank you for the plugin idea I had no idea of this option! So basically I create using the step above and simply add the function code as if it were being pasted directly into functions.php if I have understood you correctly?

    Excellent work and thanks for sharing. This has helped me to make many a plugins and left me free for future theme updates.

    It has made it a breeze to incorporate on my other sites and use the plugins for client sites also.

    Someone always asks me wherever I put my name so I shall answer the question now ” as my title suggests I am of a genuine Lordship title”.

    Thanks once again you have saved me hours!

  112. chandima
    chandima Published |

    Thank you…Thank you…Thank you… very much. I am newbie to wordpress and looking all around for a way to add custom function to wordpress, so finally found it here. Thank you for the “mu” trick and all the stuff.


  113. How to Create a Custom Functions Plugin for WordPress | BytesWire
  114. Sigit Prasetyo
    Sigit Prasetyo Published |

    wow, thank you for best tips and tutorial! 100% works for me!

  115. Experimenting with HTML5 image markup and shortcodes in WordPress - Synaptic/Dev
  116. Functions.php as a plugin
    Functions.php as a plugin at |
  117. Add Google Analytics Code To Wordpress Website
  118. Links of Interest - WordPress Development - @mwender
  119. Reply To: [Widget Shortcode] Widget icon appearing in the editor for all users? * Best Wordpress Themes - Reviews
  120. Zachary Raineri
    Zachary Raineri Published |

    Thanks for the post Justin! Finally taking that step of making my own plugins and this was incredibly helpful

  121. How to hide the main site in the "My Sites" admin menu (Multisite) - WeFoster
  122. Josh
    Josh Published |

    This is such a great tip! Thank you, Justin!

    I realized a lot of time has passed since you first published this post. Is this still your recommended method for using custom functions to extend themes or plugins?

    Also, just wanted to caution others to use a different name than my-custom-functions.php. There is a plugin in the WordPress plugin repo with this same name. WordPress will notify you of a newer version and if you update your plugin, all your work may be overwritten by the plugin from the repo.

  123. 20 WordPress Plugin Tutorials 2011 – analitics
  124. Enable Editing of the Entry Payment Details - Gravity Forms

Comments are closed.