Return to site

Finding 2450 Unused Images in a Wordpress Blog (FREE MEMORY)

Day 13 of 1095

· niche site

With my sites, I didn't always have a plan or knew what I was doing. And maybe I still don't, even though I pretend to.

One thing I do know, is having thousands of unused images accross my niche sites is a terrible use of resources.

Why unused images are bad:

  • Slows down the Uploads directory
  • Clutters the Media section
  • Wastes memory

To take care of this problem, I wasn't about to check every image uploaded to each site to see if it had an attachment page -that would take forever! I needed a different plan.

There are a million ways to take care of this issue. The one I went with was using a website auditing software to crawl my sites and produce a list of the names of images used on the site. I then produced a list of all the files in the Uploads directory. Then I removed the duplicate list items to produce a final list of all the images that were not being used on the site.

This is a very basic explanation of what I did. The end result is something I am still working on, but in the first site I ran this process through I found roughly 2450 unused images that could be deleted. I don't know how much memory this will free up across a dozen sites, but I imagine when I'm done it will be a lot.

The large number of images is because of wordpresses thumbnail feature, which multiplies the images you upload by 3. For example, 12 images would become 36. This feature can be turned off, but if you've already done the damage then all this will do is prevent wordpress from creating 3 versions of uploaded images.

You'll still need to do a cleanup, and maybe this gave you some ideas.

Freeing up memory on my server will also have the added benefit of allowing me to update whm, cpanel, and litespeed, which as of right now there isn't enough memory for. We'll see how that goes.

All Posts

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly