跳到正文
工具

媒体库大小计算器

搞清楚你的 uploads 文件夹为什么有 40 GB

在你的浏览器里运行。什么都不上传。

Your library
What's installed?

Every one of these registers its own image sizes, and every registered size is another file on disk for every image you upload.

Files on disk

Estimated total

originals + derivatives

functions.php — stop generating the sizes you don't use

These are ESTIMATES. A derivative's real weight depends on the image — a photograph and a flat screenshot at the same dimensions can differ several-fold. The FILE COUNT, though, is exact: it is simply one per registered size.

关于媒体库大小计算器

WordPress 不会只存一份你的图片——它会为每个已注册的尺寸各存一份,而且每个插件和主题还会再加。输入你的上传数量,本工具会算出媒体库在磁盘上实际占用多少空间。

FAQ

常见问题

为什么我的 WordPress uploads 文件夹这么大?

因为 WordPress 不是只存一份你的图片——它为每个注册的尺寸都存一份。核心在任何主题或插件插手之前就注册了六个。再加上 WooCommerce、页面构建器和一个带自定义尺寸的主题,单次上传就能在磁盘上变成十五个文件。

移除图片尺寸安全吗?

只移除没人用的尺寸才安全。如果你移除了主题实际会引用的尺寸,WordPress 会回退到全尺寸原图——这比你省下的磁盘空间更糟。5.3 里加入的 1536x1536 和 2048x2048 尺寸通常是可以安全移除的候选;medium_large(768w)会被 srcset 用到,一般应该留着。

我已有的那些衍生文件该怎么删?

从过滤器里移除某个尺寸只会阻止生成新的;它不会删掉已有的文件。一个重新生成缩略图的插件,或者通过 WP-CLI 运行 “wp media regenerate”,会重建整套文件并清理掉那些不再注册的。