TransWikia.com

Isolating images in uploads not used/recognised by Wordpress

WordPress Development Asked on December 21, 2021

I am looking at a website which has a lot of images in the uploads folder – but these images do not appear to be used by WordPress and do not exist in the media files.

It does appear that the original site is fairly old (2016). The images are scattered across multiple months/years. It also looks like there are multiple versions of these unknown images with different sizes.

Is there any easy way to programmatically find and remove all files in the uploads Directory which are unknown to WordPress? (If it makes any difference the OS is Linux and I am competent at the command prompt).

One Answer

It would be easier to use a plugin for this. I've been using this one for similar task https://wordpress.org/plugins/media-cleaner/. It missed some files, but removed majority of the "orphaned" images though.

Answered by Desert Fox on December 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP