Marinus Klasen

Marinus Klasen

  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

July 14, 2021

Shared media library in WordPress Multisite

Marinus Klasen

Honestly, whenever possible – I avoid the need to share media between sites but.. in this case a lot of the same media exists on multiple sites. And the hosting we’re eyeing on charges per 5GB. With a 12GB media library we want to optimise this in whatever ways possible.

Soo.. Let’s have a look in the shared media library solutions

I vaguely recall HumanMade once made a plugin for this. Let’s check it out; https://github.com/humanmade/shared-media-library

Sadly it hasn’t been updated in the last 2 years and the issues tab doesn’t seem that active either.

But you know what? HumanMade appears to have another extension; https://github.com/humanmade/network-media-library

48 open issues, recent ones as well. I browsed through them and found this comment:

To be honest it’s unlikely that this issue will see much attention as we’re planning on rewriting this library from scratch (or creating a replacement library) to address fundamental problems with mimicking attachment IDs. See #74.

That’s definitely a discouragement for using this plugin. But we found some other details in issue 74, pointing to yet another plugin by HumanMade: https://github.com/humanmade/amf-wordpress/

This plugin has recently been updated and has active issues, great! Let’s give it a try!

After activating, you can configure it via Settings -> Media. It’s as easy as just entering the URL of the website you’d like to use media from. That raises the question: Can I use other people’s media as well? 🤔

Can we though?

Well, after entering a URL of one of my own websites, I do not see any other media popping up. So initially, I’d say no. But.. I cannot get multisite media to show either.. Let’s take a dive in the code..

Ok.. Let’s start with installing the Asset Manager Framework as well; https://github.com/humanmade/asset-manager-framework

What?! It works!

That’s a quick conclusion..

So, the AMF WordPress project from HumanMade seems to be a solution for a lot of websites. You’d have to upload all of your assets into 1 main website, but when you do, you can easily use them on all other websites.

Check it out here: https://github.com/humanmade/amf-wordpress

About Marinus Klasen

Marinus has been working in software/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge.

Marinus Klasen on Twitter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Ready to take action?

I'm looking forward to discuss your projects and goals!
Feel free to reach out using the contact details below.

Marinus Klasen

[email protected]
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • An easy way to copy code blocks from the WordPress Block EditorJune 9, 2022
  • Set a static IP for docker-compose containersMay 25, 2022
  • Justified auto width in Media Carousel Widget in ElementorMay 18, 2022
  • Using the WordPress REST APIMay 18, 2022
  • Remove all edit post links in WordPress with a simple filterMay 11, 2022

Copyright © 2022 · Marinus Klasen | Webdesign by Team Rood