The uploads folder in your average WordPress site can contain a ton of random files, some of them very large. Here’s a quick way to identify the top 10 largest files in there:

Step 1: SSH Into Your Server #

You need to run the linux find command directly on the server which means SSH.

So, login to your server as root/sudo via ssh.

Learn more about ssh logins for DevelopVIDeploy servers

Step 2: Run This Find Command #

sudo find /var/www/<yourdomain.com>/html/wp-content/uploads/ -printf '%s %p\n'| sort -nr | head -10

Replace the <yourdomain.com> part of the path with your domain name.

The output should be the top 10 largest files in the WordPress uploads folder. Here’s an example of the output:

45076199 /var/www/yourdomain.com/html/wp-content//uploads/2022/01/Header-Photo-with-Texture.psd 25592723 /var/www/yourdomain.com/html/wp-content//uploads/2021/06/WebFrontPage_V4.mp4 23879041 /var/www/yourdomain.com/html/wp-content//uploads/2021/06/Village-copy.jpg 20528424 /var/www/yourdomain.com/html/wp-content//uploads/2021/06/Vertical-Header-Short.mp4 15114449 /var/www/yourdomain.com/html/wp-content//uploads/2021/06/Updated-June-2021-v1-(1).mp4 14898841 /var/www/yourdomain.com/html/wp-content//uploads/2021/08/51375928663_3ac41fd3d7_o.png 14143500 /var/www/yourdomain.com/html/wp-content//uploads/2022/02/51893222623_3de9eb3a58_o.jpg 10396860 /var/www/yourdomain.com/html/wp-content//uploads/2016/11/Eventbrite_Header.png 10342445 /var/www/yourdomain.com/html/wp-content//uploads/2022/02/Concourse-Photo.jpg 7903593 /var/www/yourdomain.com/html/wp-content//uploads/2021/06/50996962137_8ecbcebbd7_o.jpg


More Topics In Articles #