admin管理员组文章数量:1130725
(All plugins disabled) I have some strange issues with the media library. It's an old site that I have been managing for the last 2 years. The site has dated media folders on disk going back to /2010/01/.
The dropdown in media library to filter items by date only goes back to June 2013. If I select that date it shows two images. However if I look on disk there are about 70 images (not including other sizes).
I ran the following query in PMA as a routine:
BEGIN
SELECT meta_value AS filename
FROM wp_posts p
JOIN wp_postmeta pm ON p.id = pm.post_id
WHERE p.post_type = 'attachment' AND pm.meta_key = '_wp_attached_file'
INTO OUTFILE '/tmp/filenames.log'
LINES TERMINATED BY '\n';
END
Which gave me file paths from 2010 but, for example, in 2010/01 it only returned one image path when there are actually 7 images on disk in that folder.
Is there something, code or plugin, that will recurse through folders on disk and check if a media item doesn't appear in the media library and add it?
(All plugins disabled) I have some strange issues with the media library. It's an old site that I have been managing for the last 2 years. The site has dated media folders on disk going back to /2010/01/.
The dropdown in media library to filter items by date only goes back to June 2013. If I select that date it shows two images. However if I look on disk there are about 70 images (not including other sizes).
I ran the following query in PMA as a routine:
BEGIN
SELECT meta_value AS filename
FROM wp_posts p
JOIN wp_postmeta pm ON p.id = pm.post_id
WHERE p.post_type = 'attachment' AND pm.meta_key = '_wp_attached_file'
INTO OUTFILE '/tmp/filenames.log'
LINES TERMINATED BY '\n';
END
Which gave me file paths from 2010 but, for example, in 2010/01 it only returned one image path when there are actually 7 images on disk in that folder.
Is there something, code or plugin, that will recurse through folders on disk and check if a media item doesn't appear in the media library and add it?
Share Improve this question asked Dec 10, 2023 at 8:27 essexboyraceressexboyracer 1237 bronze badges1 Answer
Reset to default 1What you need is a way to scan your uploads directory and register any unregistered files. There are plugins that can help with this. One such plugin is "Add From Server". This allows you to import media and files into the WordPress uploads manager from the server's file system. Using this plugin, you can import those files from your disk into the WordPress database, which should make them appear in the Media Library.
本文标签: imagesMedia Library Issues
版权声明:本文标题:images - Media Library Issues 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736720821a1949457.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论