We are creating an internal network of sites using MU and there are some small things we would like to have globally on all the sites without having to add them individually for each site. I would like to add a block of JavaScript and CSS that will execute on every site. What's the best way of going about this?

2 Answers 2


Your answer, Kyle, is the mu_plugins folder. Create it within wp-content. Any php file put in here will be automatically loaded into ALL multisite blogs (or any non-multisite blogs).

This is a great area to put plugins vital to the site working, or shared functionality such as custom post types, taxonomies, filters, etc. Really anything! The main bonus here is when updated said "shared" files, you don't have to do it in every single theme that utilizes it! It'll be available for all themes, on all sites.

If you want to sort your stuff within mu_plugins just put everything in a nice folder structure, and create a index.php or load.php in the root of mu_plugins where you can load everything in.

From there, wp_enqueue_script just as you normally would!

  • I'm not new to WordPress usage (but not a poweruser either) but am new to WordPress programming. This sounds like a great option and definitely what I'm looking for. I know roughly some of the hooks and events that WP uses so I will research them further in light of your response, Eric. Thank you!
    – Kyle Hayes
    Jul 10, 2013 at 18:22
  • No Problem! Please mark this as solved. Jul 10, 2013 at 19:47

You should be able to register these styles and scripts in a shared plugin file, and enqueue them from within the site functions.php. Alternatively, you may attach them in the individual functions.php in the site themes you desire. In that case, remember to wrap them in conditionals in case they are not activated, found, or should you wish to manage them through some other mechanism.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.