Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Tim Boylen

Unable to sort by file size

We’ve installed and configured the PRO plugin, added the media file size column.

When we sort by file size, no items show in the media library.

I have to sort by another column to get any items to show in the media library.

Please help!

10 months, 3 weeks ago
Tim Boylen

Bumping this up and marking this so I get an email with a response.

10 months, 3 weeks ago
Stefan van den Dungen Gronovius

Can you install the plugin ‘Query Monitor’ and see if there are any errors on the page?
WordPress does not keep track of file sizes in the database.
This means that we cannot implement a fast way of sorting the items in the media file.
Instead, we created a way that needs to load every item, calculate the filesize, and put everything in the correct order. When you have lots of media files, sorting will not work anymore, simply because it will take too long or take up too much of the server resources.

In your use case, I expect that you have a lot of items, and the memory limit is hit. Unfortunately, this means that sorting will not work for that column and I advise you to disable sorting for that column. There are a few columns in our plugin that are not optimized for sorting, and this specific column is one of them.

10 months, 3 weeks ago
Tobias Schutter

We came up with a simple solution. We created a add-on for ACP which will store the file size for your media files as metadata. This allow us to create optimised sorting queries. It’s available for free on Github:

Simply click “Code > Download ZIP”. And then install it as a normal plugin.

You do need Admin Columns Pro 6.0 or greater to be able to use it.

When using it for the first time you will need to run “Bulk Edit” first to populate the metadata. Instructions are in the readme on Github.

Media File Size for WordPress

10 months, 3 weeks ago

You must be logged in to reply to this topic.