Override the default Add/Edit site forms of the Network Panel in custom plugin

Adding Markup To The Add New Site Form

You can add HTML markup to that form like this:

add_action(
    'network_site_new_form',
    function() {
        ?>
        <p>Hello World</p>
        <?php
    }
);

enter image description here

Adding Markup To The Edit Site Forms

No. This cannot be done via PHP.

For the site edit info screen, no hooks exist to do this.

However, you might be able to add a new tab however via the network_edit_site_nav_links filter, allowing you to create a custom network admin page that’s passed the site ID as a URL parameter. However you would need to recreate the tabs via network_edit_site_nav and do all the saving and displaying yourself.

What About Saving Extra Inputs When Creating a Site?

Sort of..

  • No dedicated hook is available to save those fields
  • The hook for adding the HTML is not a part of the table the existing fields are in, they will not be aligned
  • There is a hook for before and after a user is created if no user exists with the chosen administrator email, but it happens before the site is created

You can use the wp_insert_site hook to do work on the site after its creation, however you should check your fields are present, it may not even be a web request, or the network admin:

do_action( 'wp_insert_site', $new_site );

Also be wary, WP will be in installation mode when this happens, things that are normally available may not be available. What those things are is unclear.


My advice is don’t do this. The best way to customize areas of the network admin, is to remove them completely, then re-implement them using brand new network admin pages via the admin menu API.

The network admin APIs weren’t intended for extension, and the network admin was not built to be extensible in the way’s you’re wanting. Something that would normally be trivial to develop should be considered top tier super hard.

Additionally, even if you could store those values, there is no UI for viewing them, and the existing UI’s cannot be extended. You will have to build it from scratch.