最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin3浏览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?

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?

Share Improve this question edited Apr 9, 2020 at 17:42 Tom J Nowell 61.1k7 gold badges79 silver badges148 bronze badges asked Apr 9, 2020 at 17:05 Yogita Suresh TalujaYogita Suresh Taluja 1 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. – Yogita Suresh Taluja 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
Add a comment  | 

1 Answer 1

Reset to default 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/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

发布评论

评论列表(0)

  1. 暂无评论