WordPress 5.8 Media Library Changes You Should Know About

It is hard not to look through a list of upcoming WordPress 5.8 changes and not find at least a little something to whet your appetite. With so many enhancements headed our way, even we have not been able to keep up with them all here at WP Tavern. The next release will bring a few much-needed media-related upgrades.

Users should enjoy WebP image format support and a copy-to-clipboard button on the media upload screen. Developers have a new hook for filtering the image output format, and the platform is dropping infinite scrolling.

WordPress 5.8 is scheduled to ship on July 20, so these changes will be landing in less than a week. If you have not already done so, give WordPress 5.8 Release Candidate 3 a test run and report any issues.

Infinite Scroll Replaced With Ajax Button

The upcoming core release will drop infinite scrolling for media in favor of an Ajax-powered “Load more” button. The admin screen and editor’s media overlay will cap the initial and subsequent “pages” to 40 media items each.

This change is a part of an effort from the WordPress accessibility team to improve the experience for end-users. Team member and core contributor Andrea Fercia noted two a11y problems with infinite scrolling. The first is that it is impossible or nearly for keyboard users to reach content appended to the screen. Second, there is no audible feedback or instructions about how infinite scrolling works for screen readers.

He also noted usability and performance issues. Infinite scroll can break the browser’s history, and there is no JavaScript fallback. And loading hundreds or more large-sized images increases the memory footprint.

While the media library is getting the Ajax treatment in WordPress 5.8, we should expect similar updates for other areas in the future, including:

  • Add Themes Screen
  • Customizer > Add Menu Items
  • Editor > Link > Search

Copy URL From Add New Media Screen

Screenshot of the Add New Media screen after an image has been uploaded.  It now shows a "Copy URL to clipboard" button.
Copy URL to clipboard button on the Add New Media screen.

This change is an enhancement that rids the platform of a small but noticeable nuisance that has plagued it for years. When uploading an image from the Media > Add New screen in the WordPress admin, there was no way to grab its URL without clicking over to the edit screen.

WordPress 5.8 introduces a “Copy URL to clipboard” button that appears after the image has been uploaded. No need to leave the page and track down the URL. The change also makes the user experience consistent with the Media Library screen and overlay in the post editor.

More often than not, browsing Trac means seeing many of the same names. This time around, it seems that a regular user wanted a feature. They created an account — perhaps for this purpose alone –, wrote a support forum post, was directed to Trac, and created their first ticket. It took eight months to work its way into WordPress, but it is one of those success stories of an average user making things happen by just providing feedback. Thanks for the contribution, @anotia.

WebP Image Format Support

WordPress is allowing a new image format. And, no, it is not SVG (technically not an image). There are still security hurdles to jump for that to ever happen. However, it now supports WebP, which carries with it the promise of better performance for those who use it.

As Sarah Gooding reported for WP Tavern last month:

This modern image file format was created by Google in September 2010, and is now supported by 95% of the web browsers in use worldwide. It has distinct advantages over more commonly used formats, providing both lossless and lossy compression that is 26% smaller in size compared to PNGs and 25-34% smaller than comparable JPEG images.

In the report, she noted that only 1.6% (currently at 1.8%) of the top 10 million websites used the WebP format. With WordPress now adding support, that percentage is likely to rise in the coming years.

Developers: Image Editor Output Format Hook

For developers who want to transform images with one mime type to another, 5.8 introduces the image_editor_output_format filter hook. Plugin authors can convert all newly uploaded images or only overwrite specific formats.

The following example converts JPG images to the new WebP format:

add_filter( 'image_editor_output_format', function( $formats ) {
        $formats['image/jpeg'] = 'image/webp';

        return $formats;
} );

The output format will be applied to all image sub-sizes as they are created. However, this will only work for WebP images if the webserver supports it.


22 responses to “WordPress 5.8 Media Library Changes You Should Know About”

  1. I like that filter to convert image formats! However, I’m a bit hesitant to use it. All modern versions of browsers support WebP, but support in Safari is still reported to be incomplete and there’s also people with older versions of browsers. And that’s OK if you use a solution like the one in WP Smush because it provides a fallback, the filter doesn’t (that I’m aware of).

  2. Heads up, there’s a typo in the example code for the “image_editor_output_format” filter …

    $formats['image/jpg'] = 'image/webp';

    … should be …

    $formats['image/jpeg'] = 'image/webp';

    … as “image/jpeg” is the standard mime type and WP does not use “image/jpg” by default.

    • Lol right? I’ve been wondering when they’d UX that part of it for us. Simple, elegant solution, and one I’m so relieved to have as I’m building two new sites chock full of uses for this!

    • Yes, folders in library are MUCH more important and there are no any signs on horizon that this feature will appear. It’s pain in the a** since many years for web developers/designers. WordPress became business oriented CMS for company websites but was orignally designed for bloggers. So blogging heritage limit it. I suppose core developers don’t want to break comptibilty. Maybe there should be different versions/modes for bloggers and advanced users?

  3. Is there any way to disable that media library ajax button? Its terrible! what if I need a bunch of images from 10 pages in? You have to start at the start of the library every time and click your way through 10 pages to get back to where you were. it wouldn’t be bad if it was paged, I could click through to the page I wanted, but this is brutal.

  4. Hi- PLEASE give me back an option for Infinite Scrolling through my Image library in grid view!!! It is especially cumbersome when taking over a site from a new client to Load – Load – Load – Load to find images to use in their library.

  5. They could have easily implemented the infinite scroll to enable for normal users, the new system is a complete nogo for people having to work with hundreds of photos and I thought it was a bug, until I saw they implemented it for accessability reasons. I am all for accessability, but this change is poorly thought out and cripples the functionality of WordPress for most users. You could easily offer people the option to show a load more / infinite scroll or you could have detected screen readers automatically and then implemented this button only for users who need it. Instead you went for a huge change to the workflow without communicating it.

  6. The Load More button in the library is a complete pain when you are working on a site and accessing this 40 times a session. And having to add yet another plug-in when less is more to get around this “better user experience” is just weird. Who came up with this one?


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: