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

Isolating images in uploads not usedrecognised by Wordpress

programmeradmin5浏览0评论

I am looking at a website which has a lot of images in the uploads folder - but these images do not appear to be used by Wordpress and do not exist in the media files.

It does appear that the original site is fairly old (2016). The images are scattered across multiple months/years. It also looks like there are multiple versions of these unknown images with different sizes.

Is there any easy way to programmatically find and remove all files in the uploads Directory which are unknown to Wordpress? (If it makes any difference the OS is Linux and I am competent at the command prompt).

I am looking at a website which has a lot of images in the uploads folder - but these images do not appear to be used by Wordpress and do not exist in the media files.

It does appear that the original site is fairly old (2016). The images are scattered across multiple months/years. It also looks like there are multiple versions of these unknown images with different sizes.

Is there any easy way to programmatically find and remove all files in the uploads Directory which are unknown to Wordpress? (If it makes any difference the OS is Linux and I am competent at the command prompt).

Share Improve this question asked Jul 24, 2020 at 1:53 davidgodavidgo 3884 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It would be easier to use a plugin for this. I've been using this one for similar task https://wordpress/plugins/media-cleaner/. It missed some files, but removed majority of the "orphaned" images though.

发布评论

评论列表(0)

  1. 暂无评论