Create a MU-Plugin

Last updated Tuesday 15 July 2025

Each MU-Plugin follows a specific structure that must be respected for Webpack to correctly interpret your project.

Also, each MU-Plugin has its own Webpack configuration file, in which you must specify the name(s) of the MU-Plugin(s) that Webpack should process.

More

MU-Plugins are not React. Its regular JS/PHP development.

Entry Points


|— configs
    — a PHP file for load one or more of these plugins
    — another PHP file for load one or more of these plugins
|— plugins
    |— pluginslug
        |— js
            — App.js
        |— medias
            — Medias.js
        |— scss
            — App.scss
        |— template
            — index.php

Locations

  • Located in src/mu-plugins
  • Webpack configuration: configs/webpack.mu-plugins.config.js

Directories Overview

js directory:
Entry point need to be in js.

medias directory:
Use the Medias.js entry point file for import a media that you can’t import in another file.

scss directory:
You can easily switch to SASS by passing your extension file to .sass instead of .scss, by removing brackets and by replacing /scss/App.scss to /sass/App.sass in your webpack config files.

template directory:
Add to/overwrite mu-plugin production files.