Subscribe On YouTube

Join other subscribers and enjoy other Divi video tutorials!

How To Disable The Load More Button From WordPress Media Library And Restore Infinite Scroll In Divi

Nelson Miller Profile Orange
In this tutorial I will show you how to disable the annoying load more button from the WordPress Media Library and restore infinite scroll!

Are you as frustrated as I am? When trying to add an image in Divi or simply browse the WordPress Media Library, you’ll find a new button that forces you to click repeatedly just to scroll through your images. Personally, I find it incredibly annoying! Thankfully, fixing this annoyance is quite simple with a code snippet. In this tutorial, I will show you how to disable the load more button from the WordPress Media Library and restore infinite scroll!

▶️ Please watch the video above to get all the exciting details! 👆

Add PHP Code Snippet To Restore Infinite WordPress Media Library scrolling

The quick and simple way to do this is with the PHP code snippet below. We have instructions in the toggle below for where to paste PHP code if you are not familiar with it. Just remember to be careful, as PHP can cause issues if not implemented properly. After adding this snippet to your site, you can refresh the page and go to the WordPress Media Library and experience the freedom of scrolling like the good ‘ole days without the annoying load more button pagination.

Where To Paste The PHP Code

1. Divi Assistant
If you are using our Divi Assistant plugin, simply paste the code in the PHP tab in the custom code window in the Divi Visual Builder.

2. Child Theme
If you are using a child theme, paste this code into the functions.php file. If you don't have a child theme, you can generate a child theme directly on your site or download our free child theme.

3. Code Snippet Plugins
Otherwise, install a dedicated code snippet plugin, create a new snippet, and paste this code into the PHP code editor.

If you need help understanding where to paste the code, please check out our complete guide about where to add custom PHP code snippets in Divi.

// Enable infinite scrolling in the media library
add_filter( 'media_library_infinite_scrolling', '__return_true' );

Code Explanation

This line of code hooks into the “media_library_infinite_scrolling” filter and sets its return value to true using the “__return_true()” function. This enables infinite scrolling functionality in the media library of WordPress, allowing users to browse through media items continuously.

how to Disable Load More button from WordPress Media Library And Restore Infinite Scroll using the Divi Assistant plugin

Subscribe For More Things Like This!

At the start of each month, we send out a recap newsletter from the month before with family news, Divi news, our latest tutorials, and product news. Occasionally, if the news is too exciting to wait, we will send out another email separate from the monthly newsletter. That’s what you get when you subscribe, and of course you can unsubscribe if you are no longer interested!

Blog Post Optin
Divi Logo (2)

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Featured Products

Asset 4

New! Trail Guides

Follow a series of blog posts carefully arranged around a specific topic or goal! Keep track of your progress by marking posts completed, just like a free course!

View Trial Guides

Divi Trail Committee Membership badge with map design

Join The Trail Committee!

Show support for our ongoing work creating community resources at Pee-Aye Creative and enjoy exclusive member perks in return.

Learn More

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy


Comments By Members

These comments are highlighted because they were posted by fans who have a membership on this site.

  1. Vera Schäfer <span class="comment-author-role-label"><a href="" class="comment-author-role-link" rel="external nofollow" target="_blank">Divi Trail Committee Member</a></span>

    Great addition to a huge collection of helpful tips, Nelson. Coincidently I was working on a bunch of ALT editions on a media library of a client and it came right on time.


Comments By Others

  1. Eva-Maria Beck

    Thanks a lot Nelson. Very helpful :-))

  2. Matthew

    What a great timesaver. Thanks, Nelson! By the way, I had to logout and back in before it worked for me, but that could have been a CDN or caching issue.


Submit a Comment

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

Recent Posts


Your Cart