Media isn’t showing in WordPress library but is available in uploads folder

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