Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there an (easy) way to check if all my images are in the database?

I want to check my upload folder to see if each file has an 'attachment' record in the wp_posts table. I know of the extra images WP creates.

After a few migrations I'm afraid I got to much overhead, I want to check this

share|improve this question

1 Answer 1

Every time you upload an image, WordPress automatically create duplicate copies of that image and re-size them to thumbnail and medium size. Most of the time, these images are not used. In addition, there could also be some images that you have uploaded, but did not use them in the post. These unused images could easily add up to a massive size and cause unnecessarily burden to the server and database.

The DUI (Delete Unused Images) plugin scans your WordPress blog and find those images that are not used or referenced to by any of the posts/pages. It then proceeds to delete them from the database/server.

To use the plugin, you have use a FTP program to chmod the Uploads folder (the folder where images are stored) to 777. Once you have deleted the unused images, chmod the folder back to 755 again to prevent access from other people.

Similarly, you should run this plugin every few months to clear up your database.

Delete Unused Image files plugin for wordpress

Note: Unsure if this works with most recent version of WordPress. However, it is an option and worth trying.

share|improve this answer
    
sounds like what I need I'll look into it on mondag. I'll get back at you. –  janw May 17 '12 at 7:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.