• Resolved einstem

    (@einstem)


    Ok. I have a few questions as I am trying to clean-up my WordPress site and reduce it’s size.

    1) When I look in my Uploads directory, there seem to be a lot of different sized versions of several of my media files in my “uploads” directory – many more different variations then just the 3 that I expect. For some images, I see 5 or 6 different size variations. I’m not sure why they are all there since I thought when I uploaded an image, it uploaded the base image plus the thumbnail/medium/large variations, for a total of 4 images per upload. Any idea why there are more variations? Can I delete the ones I don’t need or use?

    2) I see a lot of images in my upload director that are not listed in my media library in WordPress. If I don’t need them, can I just delete them?

    3) I think I may have made an error and deleted some images in my upload directory directly instead of through the media library. Have I messed up the wordpress database? Is there any way to ‘rebuild’ the database so it is correct? Or do I need to go through the wordpress table and just delete any entries that don’t exist anymore.

    Thanks.

    Michael

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Marius L. J.

    (@clorith)

    Hi Michael,

    For your first question, the answer is simple, even though you are only given those 4 options when adding an image, themes and plugins can still request additional sizes to be made that are used at various places throughout your site, so I wouldn’t remove the ones you are unfamiliar with.

    If the images aren’t listed in your media directory, they may have been put there by a plugin, if you do wish to try removing them I would do so after taking a backup just in case.

    Removing files manually from the uploads directory isn’t the best approach, as the entries are still in the database (but it won’t break your site).
    What I’ve done when others have accidentally removed a file like this is to just go into the Media tab of my admin area and look for any broken image previews, and just select them and delete to have cleaned the database.

    I unfortunately don’t know of any plugins that solve the last bit automatically for you.

    Thread Starter einstem

    (@einstem)

    Marius,

    Thanks for the response and information.
    So, sounds like I should probably keep the “alternate size versions” of any files that are in there if that image is used (somewhere) in my theme.

    So, what it sounds like what I see in the ‘media library” is what is in my database?

    If that is true that is helpful, since there are definitely images in my “uploads” directory that aren’t in my media library at all – in any image size version. I’ll back them up just in case, but sounds like I can delete them without fear of messing up my database.

    And if I see a “broken link” in my media library, sounds like that means an entry there is pointing to a missing file, so if can either delete that entry if I don’t need that image, or restore it if I accidentally deleted it.

    Think I am starting to get this ?

    Thanks.

    Michael

    Moderator Marius L. J.

    (@clorith)

    You are absolutely correct on all points

    Thread Starter einstem

    (@einstem)

    Wow! I’ll take that to the bank! Thanks. michael

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Media Library vs Uploads Folder’ is closed to new replies.