Media isn't showing in Wordpress library but is available in uploads folder

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?

Topic vps media Wordpress

Category Web


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

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.