Delete Unscaled Images

描述

WordPress 5.3 added “big image handling” that scales uploaded images to a maximum size of 2560 pixels for use on the website. WP adds “-scaled” to the full size image file name. The original, unscaled images are kept on the server. This can mean that many large images are stored on the server that aren’t ever actually going to be displayed on the website. In my case, users are uploading 15MB files from their cameras.

After the scaled version and intermediate/thumbnail images are generated, the originals are no longer needed and just taking up storage space. Delete Unscaled Images will remove those unneeded files.

First, original images are deleted immediately after the resized versions are created for all new uploads.

Second, there is a bulk deletion tool in the Media submenu to process existing images.

安装

See the standard installation instructions at WordPress.org.

评价

2025 年 1 月 3 日
Works fine.Tested it quite good: – big images are deleted- when media upload has an error then the big image is not deleted; that's good- smaller versions do still work (when image is very small showed on website) I am very satisfied.
2024 年 11 月 11 日
I couldn't believe how hard it was for me to track down a tool that did what this plugin does: delete the oversized originals after WordPress creates the -scaled versions of uploaded images. Permanently deleting files is a risky task so I think it would be more reassuring to users of this plugin if it gave some details before they click the link to fire off the action, i.e. maybe a "dry run" that lists the files that would be deleted, without actually deleting them first. But if you know what you're doing, this is a great, easy-to-use tool for freeing up disk space — potentially a lot of disk space.
2024 年 6 月 22 日
Having local backups of all of my original source photos, and never planning to regenerate thumbnails on this particular WordPress site, I went ahead with the drastic action of deleting all the originals. This plugin was very easy to use. Just know ahead of time what you're getting into if you follow through with this action.
2023 年 5 月 24 日
This plugin is simple and fast and works brilliantly! It saves disk space usage by quickly and effectively removing all of the original, unscaled images that were over 2560px on the longest edge when uploaded.
阅读所有4条评价

贡献者及开发者

「Delete Unscaled Images」是开源软件。 以下人员对此插件做出了贡献。

贡献者

「Delete Unscaled Images」插件已被翻译至 1 种本地化语言。 感谢所有译者为本插件所做的贡献。

帮助将「Delete Unscaled Images」翻译成简体中文。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

2.0

  • Uses manage_options, so normal administrators can access it.
  • Processes attachments in batches of 100 via AJAX.
  • Handles 30k+ Media Libraries without loading everything into memory.
  • Adds a safe dry-run scan showing estimated savings.
  • Requires confirmation before deletion.
  • Validates that the active -scaled file exists.
  • Deletes only the original recorded in original_image.
  • Removes stale original_image metadata after deletion.
  • Continues deleting oversized originals automatically for future uploads.
  • Uses POST requests, nonces, capability checks and escaped output.

1.2

  • Added bulk delete Media submenu page.

1.1

  • Hooked into image upload to delete originals immediately.

1.0

  • Crude bulk process as proof of concept.