I'm migrating my old blog to Wordpress. I imported all old posts. I copied all images from the old website under uploads and the posts display everything correctly.

Folder structure

The problem is when I try to update a new media because the upload is failing and I can't see all my pictures.

Media in Wordpress

What can I do to fix this issue?


If I open Media everything seems fine

enter image description here

but when I change view I see that:

enter image description here

1 Answer 1


The problem is a failed assumption, the media library is not a file directory, it doesn't even look at the uploads folder.

When you upload things to WP, it creates an attachment post, and it's those that get shown in the media library. Otherwise, if it just listed what was in the uploads folder, every file would appear 3 or 4 times for each image size. Not only that, where would it store the descriptions, titles, etc

So to get these images to appear in the media library, you should have migrated the attachment posts, not just the post and page posts. Adding them to the database would fix this

You might also have issues with nav menus, as there are other custom post types WordPress uses behind the scenes, e.g. nav_menu_item.

Also, because you didn't migrate attachment posts, if you restore them they may have incorrect post IDs, which means all your featured images will be broken, and possibly a number of other things such as header images in themes. This is because plugins and themes are meant to store the attachment ID, then ask for the image size they want, instead of storing the URL. As a result you might need to clear your database, and migrate again from scratch.

If you're using the WordPress importer, make sure to export all content, and when you import, that you tell it to import media

  • Thank you. I'm importing posts from BlogEngine and I created the WXL file for the posts. I have more than 5000 posts and a lot images. Is there a way to import all my images? Mar 26, 2020 at 10:02
  • Also, how can I fix the problem? If I delete all images from uploads folder, I can't upload any image. Mar 26, 2020 at 10:12
  • Ooh, being unable to upload new images is a different and unique problem that's unrelated to what you asked. Also, that you're importing from a different CMS is really important information, you should edit your original question to include that information prominently. It's almost a completely different question :( Make sure your questions is self contained and includes everything needed to answer it, a lot of people don't read comments on questions and answers
    – Tom J Nowell
    Mar 26, 2020 at 11:25

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.