I've been given the directive to "retire" about 1000 articles from a wordpress site I maintain. Deleting the posts from the DB is trivial, but how would one go about deleting the orphaned files from the uploads folder?
2 Answers
Try plugin called 'Media Cleaner'. It's seriously made (the author, tigroumeow, mention 5+ time "do a backup before use") + upload Janitor was last time updated 10 years ago.
take a look at Upload Janitor plugin. its a plugin i use to clean up unused images and other files from your uploads folder.
but just in case make a backup of your uploads directory first
-
That's the one. I knew there was something like that. Thanks! Commented Jan 31, 2011 at 19:31
-
Interesting plugin. It seems to be dealing with the backup thing as well - taken from the plugin description: "Before any action is taken, Upload Janitor will automatically make a 'tar' archive of all files to be erased, including their original paths, so you can restore if necessary." Commented Jan 31, 2011 at 19:59
-
-
Any ideas for a suitable replacement to upload janitor for Wordpress 3.0+, given that it doesn't support WP3?– user16797Commented Jun 6, 2012 at 14:06
-
1@rilwis No. From the looking at the source, it looks like the plugin only considers images included in the body of posts.It doesn't look for post thumbnails ("featured images"), for custom meta values, or for references to images in your stylesheet. Though I'd say that images referenced in your stylesheet are better kept in your theme directory, rather than your uploads dir (I assume that stylesheet references are what you mean when you talk about slider, social icons, etc.). Commented Jun 6, 2012 at 15:12