• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Change the number of items displayed in WordPress media library

Learn in this tutorial how to modify the number of files displayed in the WordPress media library using code.

When you are in the WordPress media library in list mode 20 items are displayed by default. And there is no graphical interface to modify this number.

But what happens if you want to display more? Or less?

Well, that’s okay, because you can achieve this using the filter upload_per_page.

And here’s how to do it:

Snippet to change the number of files displayed the WordPress media library

Add the following code at the end of functions.php or in your functionality plugin:

To see this and another 965 code snippets of this website, login or subscribe here.

In this fragment you use the filter upload_per_page to indicate to display 100 entries.

Of course, you can change the value to whatever you want.

I do not recommend using numbers higher than 100-250 as it may overload the server while browsing the media library. Or if you do, do it only temporarily. 😉

Conclusion

Thanks to this tutorial now you know how to change the number of files displayed in the WordPress media library.

Any questions? I read you in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

Archive PHP WordPress

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?