WordPress 5.8 – Disable “Load more” in the media library

WordPress 5.8 was released a few days ago with many new features. One thing that doesn’t necessarily get everyone’s approval is the “Load more” button in the media library and when adding images to galleries.

Only 40 pictures are displayed at a time and you have to click on “Load more” again and again for more pictures. Of course, this is extremely annoying when there are a lot of pictures that you want to insert.

Until maybe there is an option to do so, one can solve the problem as follows. A line must simply be added to function.php or alternatively with a code snippet plug-in

The following line restores infinite loading:

add_filter( ‘media_library_infinite_scrolling’, ‘__return_true’ );

The new button then disappears and all images are loaded as before.