How To Share Media Across WordPress Multisite
WordPress multisite installs might use a single codebase but when it comes to media each site operates in its own silo.
If you are using multisite to publish multiple sites then reusing media across your sites either means inserting with a url or loading the image up twice. Hardly satisfactory.
In this Weekend WordPress project, we’ll take a look at how to share images, video and audio across your site, saving you considerable time, trouble and disk space.
Why is this important? In a default multisite install each site has its own media library, with no built-in capabilities to easily access media from other sites. The choices are either use the Insert from URL facility or load up the image into each site.
If you have a widely used set of images, such as logos or icons or portraits, then you have to either link to the original source (and trust that the URL doesn’t change) or load each item up in the site where you want to use it.
Clearly, the better option is to be able to select media from any site on the multisite network for insertion into a post and to not have to duplicate it. And preferably, have the URL look and feel as if it is local to the post’s site.
This is exactly what Network Shared Media provides.
Installing and network activating the plugin (there’s no need to activate on the individual sites) adds a new option, Network Shared Media to the Add Media dialog:
Clicking on this new option, displays the media as normal but creates a new menu bar with links to each site on the network. Clicking on a site brings up the media for that site.
Selecting and inserting a media item is exactly as before (clicking on the Insert into Post button) but what’s interesting is that the plugin localizes the URLs, so although there is only one source, the URL is for the current blog, not the original.
For example, here’s the img tag and a tag for an image inserted into a post on Blog A but that physically actually resides in the primary site’s uploads folder (http://www.multisite.dev/wp-content/uploads).
<img class="alignnone size-medium wp-image-nsm-1-11"
alt="" width="155" height="300" />
No Featured Image Support
The only real drawback with the plugin is that it’s functionality doesn’t extend to the Featured Image selection tool.
This is not really the plugin’s fault as, and I hadn’t ever noticed this before, the Featured Image dialog is not the same as the Add Media button. It only allows for picking directly from the site’s media library or uploading a new item and doesn’t support Add Media functionality such as Insert from URL.
One For The Multisite Publisher’s Essential Plugin List?
If you use WordPress in multisite mode to manage several websites, then this plugin offers a time-saving way of sharing common media across those sites.
For that reason alone, it’s a prime contender for the Essential Plugin list for WordPress multisite operators.