0

I am trying to migrate my site from shared hosting to the digital ocean. I have uploaded wp-content and my site is over 3 years old. Now when I am checking into the media on the dashboard. Files aren't showing.

Ideally, all the months should be visible but as you can see in the image only selected no of months are shown. How can I get the Wordpress to show all the months and images?

enter image description here

3
  • How did you migrate the content? Note that the media library isn't listing files in the uploads folder, it's listing posts of type attachment
    – Tom J Nowell
    Commented Apr 9, 2020 at 17:42
  • I transferred the wp-content to /var/www/html. since I have already installed the Wordpress all I did is replace it with mine. Commented Apr 10, 2020 at 5:15
  • Ah then there's your problem. You could put 10 years worth of images in wp-content, that doesn't mean it would show in the media library
    – Tom J Nowell
    Commented Apr 10, 2020 at 10:13

1 Answer 1

0

There's a really basic but broken assumption here:

The media library does not display files in wp-content

The media library is the same as the posts or pages screen, it's a list of posts that just shows the posts a little differently.

When you upload a file to WP, it creates a post of type attachment, and that's what's shown in the media library. Otherwise WP would have nowhere to store attachment meta, titles, descriptions, comments, etc.

In fact attachments have their own theme templates and permalinks, for example here's the attachment page for an image I uploaded to my own site:

https://tomjn.com/2017/08/31/where-gutenberg-leads-us/screen-shot-2017-08-31-at-14-13-54/

Attachments can have taxonomies, post meta, comments, etc

If the media library was a file browser, then every resized image would show up in the media library too.

So when you state:

Files aren't showing.

That's incorrect, the media library does not show files. It shows attachment posts.


So why is it that only some of your media library shows up? Because not all of the attachment posts made it across in the migration. The presence of the files is irrelevant. If all the posts made it across but files were missing, they'd still show but with broken images that lead to 404s

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.