How can I remove images that have been deleted from the upload folder, from the Media Library?

  • How did you delete them? Physically from the storage or? – Max Yudin Sep 19 '18 at 10:09
  • @MaxYudin Yes, phisically deleted from the uploads folder – Pim Sep 19 '18 at 10:21
  • You have to edit the database now. – Max Yudin Sep 19 '18 at 10:32
  • Is there no way to do this programtically? I can still delete the images in bulk from media library without touching the DB, but I'd like a different solution. – Pim Sep 19 '18 at 10:34
  • 1
    Yes. Parse posts having images, extract all images' URLs from the content, compare with the list of existing images, spy out deleted and replace those <img /> tags with something or simply delete. – Max Yudin Sep 19 '18 at 10:54

You can delete Images from Admin panel Media Tab manually using Multi-select Deletion option OR Delete from DB also as per media attachment ids. I think Multi select deletion from Media tab is the best way to delete. Hope this will help you!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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