Opened 9 years ago

Closed 9 years ago

#1064 closed defect (bug) (invalid)

WordPress loses Attachment data if the image file is missing.

Reported by: webmaster808's profile webmaster808 Owned by:
Milestone: Priority: highest omg bbq
Component: General Keywords:


I suppose this could be seen as a feature, but in my world it appears to be a fatally critical flaw.

We recently had a data loss on our server where at random some of our image files disappeared. Not sure how many, we have close to 4,000 images. The majority were not lost.

We have a backup of the image files, however when we restored, we found that all of those attachments and their relationships (i.e. as a featured image) are gone and are no longer in the Media Library.

So, for instance on a page that had a featured image and 2 images inserted into the post, the images that were inserted into the post appear properly because the files exist in the filesystem and the links are hardcoded into the post. However, if you go into the media library to re-define the featured image and perhaps re-insert(or edit) one of the images that thad been previously inserted, they do not exist in the media library any more. Also, the caption, alt text, etc. is GONE! This makes a webmaster a very, very sad person. Depending on how many images were lost, one might see this as a catastrophic failure. omg bbq!

I have a database backup and *may* be able to rebuild this data, but it would be awesome if we found a way to ensure this would never, ever happen in the first place.

It seems that WordPress should be able to maintain this data even if the image files have gone missing and not be deleted until someone manually deletes them.

I would love to help fix this, if possible. Alternatively, I would love to hear of an easy way to repair this damage, if known.


Change History (1)

#1 @samuelsidler
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed


I think you meant to report this issue to the core trac. This trac is specifically for issues with and its systems and services, not with the core WordPress project. Please file your ticket at

Note: See TracTickets for help on using tickets.