I have built my own WordPress theme and applied it to my WordPress website.

The issue I am having is out of the blue, the thumbnail images from the media gallery have stopped loading in and now just appear as blank squares... (Please see image)

enter image description here

I think this happened after I went into the server and deleted everything out of the wp uploads folder as I wanted to start fresh and through this would be the quickest way to get rid of all of the images.

Since then, it seems to not be loading in any thumbnails of any new images I upload so I can't see what is actually in the media library... Kind of annoying.

I have tried using the force Thumbnail regeneration plugin and this also didn't work.

How can I get the images back, please? :(

Thank you

  • Just to mention - nothing in my theme should be impacting on the media library. It works fine in my dev area but not on my preview testing server
    – Emma Dalby
    Feb 13, 2019 at 10:54

1 Answer 1


Deleting the files out of the uploads folder is almost certainly the culprit here. Your theme may have custom code that affects the Media Library, but since you wrote it and you don't think there is you're probably right :) So we can assume it's the uploads folder. There is a database entry per file, and if those entries were not deleted now WordPress's database and the files don't line up.

You may get a clue as to what's happening if you inspect the missing thumbnail and see what the thumbnail URL it is is looking for is. What is the URL of the thumbnail, and does that file actually exist (verify via FTP)?

I'm not sure why it would affect new file uploads like you say, but since you don't have a lot of uploads anyways I would recommend starting from scratch with your uploads.

If you are able to click each of those missing thumbnails and manually delete the entry, until your media library is completely empty, do it that way.

Since there may be a database issue involved, I would personally suggest then going and looking in the database to make sure there aren't any leftover "attachment" type items in your wp_posts table. There's also some post_meta rows for each item. It would be great to know those are gone too, but that may be a little more difficult to work through if you have a lot of other posts, and they shouldn't matter if the posts are gone.

Then upload a new file and see what happens.

  • Good answer, I'd also suggest enable debug mode and checking the error log to see why new uploads are not working. I'd agree with you that the images are simply missing on the staging server. Feb 13, 2019 at 11:18
  • So I started following your steps and went into the wp_posts table an then it clicked... for some reason it was defaulting to http instead of https... I changed it back to https and it's working now! Thank you :)
    – Emma Dalby
    Feb 13, 2019 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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