• I’d like to delete all the images in my media library that I’m not using and change the size of all the images that I am using. I know if I go in to list view it tells me whether an image is “attached” or “unattached”, but you can’t go by that because it’s unreliable – it lies to you. Why is that? Does wordpress’s media library have a bug?

    For example. I have 5 of the same image uploaded, but they’re all different sizes. I know for a fact that I’m only using one of them on my confirmation page and nowhere else. I had to keep resizing it until it looked good – that’s how I ended up with 5. Yet, all 5 images say “attached” to the “confirmation” page. I can see on my confirmation page that there is only one image, not five.

    And if I unattach all 5 of them, including the one with the same size as the one on my confirmation page, you would think the image would disappear from the confirmation page, but it doesn’t. Even after deleting cache and doing a hard refresh and coming back an hour later – the image is still on the confirmation page.

    I have this problem with other images too – it says some are “attached” when they’re not. And unattaching them doesn’t make them go away.

    So, what’s the deal with that – does wordpress have a bug or something?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hey kuurt,

    Sorry to hear that you are having trouble but I must say Media Library is not buggy, Attach/Unattached feature works well.

    I have tried to reproduce your issue on my site but it’s not causing issue, working like a charm.

    It may be the possibility that either some plugin or theme itself causing the issue.

    Please try to switch to default theme and then check.

    Also try to deactivate all plugin one by one until you find which is causing issue.

    To delete unattached images, you can follow below steps:

    1. Choose unattached from drop-down and click on filter https://goo.gl/mpL7CD, it will show all unattached images
    2. Then select all images and choose Delete Permanently from Bulk Action drop-down, click on Apply.

    I hope it will help you.

    Good Luck
    Juhi

    Thread Starter kuurt

    (@kuurt)

    I don’t know why it’s working for you, but it isn’t working for me. I tried deactivated all my plugins, but that didn’t help. I also tried switching themes. I don’t see a “default” theme anywhere, even if I do a search for “default”, but I tried other themes, including twentysixteen, but it didn’t make a difference.

    There’s no way I’d try delete all unattached images, because it would probably end up deleting images that I didn’t want to delete. Those 5 images I mentioned earlier all say “unattached”, yet I know one of them is being used on one of my pages because I can see it.

    Thanks for trying to help though – those were good ideas that I hadn’t thought to try. Unfortunately they didn’t work.

    Can anybody think of anything else that might be causing this issue?

    Moderator Kathryn Presner

    (@zoonini)

    kuurt – you might want to try a plugin that’s designed for this task, like this one:

    https://www.ads-software.com/plugins/dnui-delete-not-used-image-wordpress/

    And there are others:

    https://www.ads-software.com/plugins/search.php?q=image+cleanup

    I have not used any of these myself so I can’t vouch for them directly. I’d suggest you look for one that has been updated recently and has good reviews and a decent support track record.

    To delete unattached images, you can follow below steps:

    1. Choose unattached from drop-down and click on filter https://goo.gl/mpL7CD, it will show all unattached images
    2. Then select all images and choose Delete Permanently from Bulk Action drop-down, click on Apply.

    An image can be “unattached” in WordPress terms and still in use in a post or page, so deleting unattached images is not the right way to find images that are not in use.

    Let us know how it goes.

    Is there a way to find out what images are not in use?

    As Kathryn said above an image can be “unattached” in WordPress terms and still in use in a post or page, so deleting unattached images is not the right way to find images that are not in use.

    How can you tell which media files are being used? I am not talking about attached or unattached. I am talking about any media that is not being used by the website.

    @chaseaidan, @chgorin

    @zoonini posted a link to a plug-in that finds unUSED images.

    I know this is a bit confusing, but it’s important to understand that attachment and usage is not the same thing:

    • a media file can be attached but not in use
    • a media file can be unattached but in use
    • a media file can be attached to post A but only be used by post B

    So then, how do you tell if a media file is not being used by your web site? How do you tell if a media file is not “in use” by the website? We don’t have a blog.

    I don’t understand how your last sentence relates to the question, but to answer your question in general: If a media file is used then it is referenced by its filename and path somewhere in the source code of a post or page. So if the filename cannot be found then the media file is not used.

    Ok, so someone else was managing our website, but now I am in charge of it. There are a lot of duplicates in our media library. Do I have to go through each page of our site to find if a media file is actually being used or is there an easier way of telling?

    The easier way would be using a plug-in like the one mentioned above.

    Unfortunately, those suggested plugins have not been updated in quite a while, and thus are not compatible with the latest WordPress update. The Reviews support that fact as well.

    Unfortunately, it does not look like there is a current plugin to help with finding/deleting unused images.

    Martin Sauter

    (@martinsauter)

    I just had a quick look at DNUI (https://www.ads-software.com/plugins/dnui-delete-not-used-image-wordpress/). It was updated just 5 months ago, and in my test environment it worked fine. What makes you think it is not compatible with the latest WordPress version?

    thurmbo

    (@thurmbo)

    Martin, maybe I’m not understanding… I’m just basing my assumption on the fact that the DNUI description page says it’s compatible up to WP 4.6.3.

    I have had nightmares with plug-ins taking down my entire site because I’ve updated without paying attention to the “compatibility date”. That is why I stated as such.

    Unfortunately, I don’t have time to be testing each plugin that is not kept current.

    Are you saying that one should not pay much credence to the “compatibility date” (in general), or in this case, it would be okay to use – as I really would like this plug-in to work for me – I’m in dire need of it right now.

    Thanks in advance.

    Martin Sauter

    (@martinsauter)

    According to my experience, “Compatible up to” doesn’t necessarily mean that it’s NOT compatible with more recent WP versions. I’ve installed DNUI on WP 4.7.2 and it did not take my whole site down. However, I do NOT guarantee that it works properly in all aspects – you have to test it yourself.

    thurmbo

    (@thurmbo)

    Martin, thank you. That gives me some hope, and I’ll give it a shot.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How do you tell which images in your media library aren't being used?’ is closed to new replies.