Hot to Use the WordPress Multisite Shared Media Library
The plugin usage is pretty straightforward; all you need to do is activate it for your multisite network and optionally decide which gallery type better fits your needs and a media library of which site you’re going to use as a network library.
Activate for the Multisite Network
In order to activate the plugin you just need to go to Network Admin > Plugins and then click “Network activate” link.

Configure the plugin (Optional)
Once you’ve installed and network activated the plugin, you can go in your network dashboard to Settings > Network Media and configure it.

As you can see in the screenshot above, here you can choose the type of the shared media library which is going to be used across your multisite network.
Let me describe each one of the options.
| Library type | How it works |
|---|---|
| “Display in a separate tab” | This library type allows you to use media files from both local and global media libraries on your sub-sites. The “Shared media” tab will be added. When you upload a new attachment it will be added to the site where it was uploaded. If it is uploaded on the main site, it will be available in a network library. |
| “Replace local media library” | Seamlessly replaces local libraries on sub-sites with a shared global library. When you upload a new media file on any sub-site, it will be uploaded to the network library. |
You can switch the media library type anytime.
Change a site which is used for the Network Media Library (Optional)
By default, the plugin is going to use the main site of your network as a network library. If you want to change that, I recommend doing it right after the plugin installation.
Since this action is not supposed to be done very often, I decided that it should be configured not in the plugin settings but with a filter hook:
/**
* Plugin name: Change Network Media Library Site
* Author: Misha Rudrastyh
* Version: 1.0
* This plugin allows to change the ID of the network media library main site.
* Network: true
*/
add_filter( 'rudr_sml_network_library_id', function( $network_library_id ) {
// set a site with ID = 2 as a multisite global media library
$network_library_id = 2;
return $network_library_id;
} );Don’t know how to use this code snippet?
Just create any PHP file in your wp-content/plugins folder, for example change-network-library-site.php and paste this code there. Then go to “Plugins,” and network activate this brand new plugin. Another way – is to use this code as a code snippet.
Of course, don’t forget to change a site ID on the 10th line of this code. Where to get it? If you go ahead and edit any of your sites on the Sites page, you can find its ID in the URL.