I have a word press blog and all was fine and one day suddenly all the images in the website have disappeared ..

I see the images are there in the wp-content/uploads/ in there specific directory(month & year) but nothing is visible in media library

I also noticed all the pages, posts were turned to draft . I republished them but still can't access images in media library ..

In settings/media/

I have checked the option

 Organize my uploads into month- and year-based folders

but don't see the the option to put the path of uploads folder..

I hope somebody will help in identifying the bug and fix it..

Thanks in advance

  • It's better if you upload a screenshot of your media library and your developer tools (console) open. (in Chrome: Ctrl+Shift+J ) – pooria Mar 6 '17 at 19:01
  • What version of WordPress are you using? And what host? Sometimes hosts do weird things to their file systems that can bork the database. Also, based on what you said about all the posts being returned to draft, it sounds like your site may have been hacked. – Ian Mar 15 '17 at 3:07
  • @Ian wordpress version is 4.7.3 now but I don't remember what it was when things broke . Host is Godaddy.. Ya hack may be the case.. :( – terminator Mar 15 '17 at 6:02

The two problems you describe may very well be related. Attachments (images) are stored as posts in the database (so title, caption and so on can be stored in relation to the physical image file). It is this post that you see in the image library.

Normally, the post_status of attachments is inherit. However, if the post_status is set as draft the post won't be visible in the media library anymore, even as the physical file is still there and the title/caption is still stored in the database.

So, my guess is that either malware or a rogue/ill-programmed plugin has set all you post_statusses to draft. To find out, you should open your PHP Admin, and check the post_status column in the _posts table of your database. If there aren't a lot of images you can change the post_status manually to make the image posts reappear in the image library (try at least one the check if this solves your problem). Else you'll have to run an SQL query on the table.

  • @cjbi thanks a lot for your valuable insights.. this realy makes sense that all the post attachment's status has been turned to draft ... I will try the solution today and let you know – terminator Mar 20 '17 at 8:02

Unless you haven't updated your WordPress for a long time, you shouldn't have been able to change your upload folder through the Dashboard anyway. This feature was removed in version 3.5, if I'm not mistaken.

First, back up everything (your WordPress installation, especially everything under wp-content, and your database). Now what you can do is:

Check your wp-config.php

  1. Look for a line similar to define( 'UPLOADS', 'wp-content\path );. This is the only way to change your media directory on newer versions of WordPress.

  2. If you see code like that, try deleting it from wp-config.php.

Install the latest version of WordPress

  1. Download the zip from WordPress.org.
  2. Copy the zip to your WordPress directory.
  3. Move out wp-config.php.
  4. Delete everything in your WordPress directory except for the wp-content folder.
  5. Unzip the file you downloaded from WordPress.org. You'll see a new folder called wordpress. Copy everything from there into your original WordPress directory.
  6. Put back your wp-config.php.

Ask your host to revert your site to an earlier state

This is a last resort. Just ask your host if they can revert your site to a time before you noticed your image access problem.

Whatever you decide to do, you an always restore your backups in case anything else goes wrong.

Good luck!


Just adding a solution I had when my images in the media bay was not showing up i could still see the names and click the edit button but I only got a small blue square and no image even though they was on the server. The solution that worked for me was to install a thumbnail regenerate plugin and regenerate the images after this they all showed up in the media bay. I don't know if this is the issue your having as mine was not set to draft but thought I would share in case someone else comes across this and finds this solution useful.


Please check your images img src ftp or cpanel folder upload directory

enter image description here

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.