bueltge / multisite-global-media
Multisite Global Media is a WordPress plugin which shares media across the Multisite network.
Package info
github.com/bueltge/multisite-global-media
Type:wordpress-muplugin
pkg:composer/bueltge/multisite-global-media
Requires
- php: >=8.3
- composer/installers: ^1.2 || ^2.0
Requires (Dev)
- brain/monkey: ^2.2
- inpsyde/php-coding-standards: ^2
- johnpbloch/wordpress-core: ^5.0
- php-stubs/acf-pro-stubs: ^6.0
- php-stubs/woocommerce-stubs: ^11.3
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.5.22
- squizlabs/php_codesniffer: ^3
- szepeviktor/phpstan-wordpress: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-19 16:30:05 UTC
README
Multisite Global Media is a WordPress plugin that shares media across the Multisite network.
Description
This small plugin adds a new tab to the media library, which allows you to share media from one site to all the other sites of the network. By default, the Site ID is set to 1. You can change this Site ID via the filter hook global_media.site_id, see Set your Site ID for the Global Media Library.
Global media can be used in
- the media modal of the editor (insert into content, responsive images),
- the featured image of posts,
- the REST API (featured image of posts),
- the WooCommerce product gallery,
- the ACF image field.
To get Global Media to work, please follow these steps:
- Decide which site will host the shared media for the network.
- Add media to the media library of the chosen site.
- Find the Site ID of your chosen site by going to your Network Admin. In the left-hand menu, choose "All Sites", and then click on "Edit" under the site you need. In the address bar, you will see
site-info.php?id=4where the last number is the ID.
- If the Site ID of your chosen site is
1, then you don't need to make any changes. If it's a different ID, please read the section below about changing the Site ID via hook.
Note: A useful enhancement in the Multisite context is the plugin Multisite Enhancements. It also helps to identify the site and its Site ID.
Requirements
- WordPress Multisite
- PHP 8.3 or higher
Set your Site ID for the Global Media Library
If you need to change the default Site ID 1 to another value, create a small Must Use plugin.
- Create the file
/wp-content/mu-plugins/mgm-set-my-site-id.php. WordPress loads only PHP files placed directly inmu-plugins, not in sub-directories. - Add the following content and change the return value to your chosen Site ID.
<?php /** * Plugin Name: Multisite Global Media Site ID * Plugin URI: https://github.com/bueltge/multisite-global-media/ * Description: Set my Multisite Global Media site in the network. * Version: 1.0.0 * Network: true */ add_filter( 'global_media.site_id', static function (): int { return 1234; } );
- Activation is not necessary, Must Use plugins are always active.
Installation
Manual
- Download
multisite-global-media.zipfrom the assets of the latest release. This zip is ready to use and contains the autoloader, no Composer required. The automatically generatedSource codearchives do not work without Composer. - Upload the zip via Network Admin > Plugins > Add New > Upload Plugin, or use Composer, see below.
- Install the plugin in your environment, recommended as Must Use plugin.
- Optional: The Must Use Loader is helpful if you use more than one Must Use plugin stored in sub-directories.
- Set the Site ID for the Global Media Library, see above.
- Activate the plugin for the whole network if you don't store it as Must Use plugin.
Composer
The plugin is also available as Composer package.
composer require bueltge/multisite-global-media
Screenshots
Contributing
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Run the checks (
composer qaruns PHPUnit, PHPCS and PHPStan) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
See DEVELOPMENT.md for the local Docker environment.
Other Notes
Bugs, technical hints or contribute
Please give feedback, contribute and file technical bugs as issues in this repository.
License
Good news, this plugin is free for everyone! It's released under the GPLv2+.
Contact & Feedback
The plugin is designed and developed by Frank and team members from the Syde crew. Special thanks and praise to Dominik Schilling and Guido Scialfa for their help and engagement.
Please let me know if you like the plugin or you hate it or whatever.
Please fork it and improve the plugin, see the contributing note above. Add an issue for ideas and bugs. We also say thank you for improvements in the documentation and help in the support.


