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

This site runs on Cloudways.
It's fast isn't it?
Cloudways offers high-quality, fast and affordable hosting.

Learn more

Need a hand? Post your project and hire me and other top notch developers on Codeable.

Hire me on Codeable

Comments

  1. j0e says

    July 17, 2022 at 1:16 pm

    I am getting a fatal error after activating.

    Fatal error: Uncaught Error: Call to undefined function AMFWordPress\bootstrap() in /home/customer/www/website123.com/public_html/wp-content/plugins/amf-wordpress-main/plugin.php:30 Stack trace: #0 /home/customer/www/website123.com/public_html/wp-admin/includes/plugin.php(2313): include_once() #1 /home/customer/www/website123.com/public_html/wp-admin/plugins.php(192): plugin_sandbox_scrape(‘amf-wordpress-m…’) #2 {main} thrown in /home/customer/www/website123.com/public_html/wp-content/plugins/amf-wordpress-main/plugin.php on line 30

    Any ideas to push me in the right direction? I’m a bit noob, but learning.

    Reply
    • j03 says

      July 17, 2022 at 1:16 pm

      ps thanks

      Reply
    • Marinus Klasen says

      July 18, 2022 at 9:31 am

      Did you install the Asset Manager Framework?

      Reply

Leave a Reply Cancel reply

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

Get in touch

Contact me using the details below

Marinus Klasen

Wilhelmina van Pruisenweg 35, 2595 AN Den Haag

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

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • Disable the ‘Password Changed’ Email notification in WordPress with a filterAugust 30, 2023
  • A-Frame: Change an objects color on hoverAugust 24, 2023
  • Connecting to a Cloudways application with VSCodeAugust 15, 2023
  • Force refresh PHP-FPM or Litespeed cacheAugust 4, 2023
  • Only return zip/postal codes from Google Places AutoComplete Javascript APIJuly 19, 2023

Copyright © 2023 · Marinus Klasen | Webdesign by Team Rood