Title: HK Media Optimizer
Author: Harikrut Technolab
Published: <strong>2026 年 7 月 10 日</strong>
Last modified: 2026 年 7 月 10 日

---

搜索插件

![](https://ps.w.org/hk-media-optimizer/assets/banner-772x250.png?rev=3603288)

![](https://ps.w.org/hk-media-optimizer/assets/icon-256x256.png?rev=3603288)

# HK Media Optimizer

 作者：[Harikrut Technolab](https://profiles.wordpress.org/harikrut/)

[下载](https://downloads.wordpress.org/plugin/hk-media-optimizer.1.0.0.zip)

 * [详情](https://cn.wordpress.org/plugins/hk-media-optimizer/#description)
 * [评价](https://cn.wordpress.org/plugins/hk-media-optimizer/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/hk-media-optimizer/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/hk-media-optimizer/#developers)

 [支持](https://wordpress.org/support/plugin/hk-media-optimizer/)

## 描述

HK Media Optimizer scans your WordPress Media Library and tells you exactly which
files are no longer used anywhere on your site, so you can safely delete them and
reclaim disk space.

Unlike heavier media-cleaning tools, HK Media Optimizer is built around a simple
rule: never do more work in one request than necessary. Every scan runs in small,
configurable batches over AJAX, so it works comfortably even on modest shared hosting.

**Where it checks for usage:**

 * Post and page content
 * Featured images
 * Direct attachment relationships (files uploaded into a post)
 * Custom fields / post meta
 * Advanced Custom Fields (ACF) values, if ACF is active
 * Widgets, including block-based widgets
 * Theme Customizer settings (logo, background, header image)
 * Site icon

**Built for control:**

 * Turn any scan source on or off
 * Protect recently uploaded files with a configurable safety window
 * Whitelist specific files or whole folders
 * Exclude file types you never want flagged (PDFs, ZIPs, etc.)
 * Adjust batch size to match your server’s resources
 * Optional “type DELETE to confirm” safeguard before permanent removal

**Find duplicate files:**

 * Compares every file in your library by its actual contents (not just filename),
   so true duplicates are found even if they were re-uploaded under a different 
   name
 * Groups duplicates together and shows how much space each group is wasting
 * Always keeps at least one copy from every group — server-side, even if you select
   every file in a group for deletion

**Export & reporting:**

 * Export your unused, in-use, or full scan results to a CSV file at any time
 * Optional scheduled scans (daily/weekly/monthly) with an email summary report —
   nothing is ever deleted automatically by a scheduled scan

**Lightweight by design:**

 * No data is sent to any external server — everything runs locally on your site
 * Scan results are stored in their own dedicated database tables, not in `wp_postmeta`
   or `wp_options`, so your site’s core tables stay fast
 * Assets (CSS/JS) only load on the plugin’s own admin screens, never elsewhere 
   in wp-admin
 * No background cron jobs running on a schedule unless you explicitly turn on Scheduled
   Scans in Settings

## 屏幕截图

[⌊Scanner page with real-time progress tracking, summary cards, and scan status 
for unused media files.⌉⌊Scanner page with real-time progress tracking, summary 
cards, and scan status for unused media files.⌉[

Scanner page with real-time progress tracking, summary cards, and scan status for
unused media files.

[⌊Unused Media page listing all unused attachments with bulk actions, file details,
and safe deletion options.⌉⌊Unused Media page listing all unused attachments with
bulk actions, file details, and safe deletion options.⌉[

Unused Media page listing all unused attachments with bulk actions, file details,
and safe deletion options.

[⌊In-Use Media page showing media currently referenced across your website, along
with the exact usage location.⌉⌊In-Use Media page showing media currently referenced
across your website, along with the exact usage location.⌉[

In-Use Media page showing media currently referenced across your website, along 
with the exact usage location.

[⌊Duplicate Finder displaying grouped duplicate files, reclaimable storage space,
and tools to safely remove redundant copies.⌉⌊Duplicate Finder displaying grouped
duplicate files, reclaimable storage space, and tools to safely remove redundant
copies.⌉[

Duplicate Finder displaying grouped duplicate files, reclaimable storage space, 
and tools to safely remove redundant copies.

[⌊Settings page with configurable scan sources, post status filters, safety rules,
performance tuning, scheduled scans, and deletion safeguards.⌉⌊Settings page with
configurable scan sources, post status filters, safety rules, performance tuning,
scheduled scans, and deletion safeguards.⌉[

Settings page with configurable scan sources, post status filters, safety rules,
performance tuning, scheduled scans, and deletion safeguards.

## 安装

 1. Upload the plugin files to `/wp-content/plugins/hk-media-optimizer`, or install
    directly through the WordPress plugins screen.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. Go to **Media Optimizer** in your admin menu to run your first scan.
 4. Visit **Media Optimizer  Settings** to customize scan sources and safety rules 
    before deleting anything.

## 常见问题

### Does this plugin delete files automatically?

No. HK Media Optimizer never deletes anything on its own, even with Scheduled Scans
turned on — scheduled scans only update the results and (optionally) email you a
summary. It only flags files as unused; you choose what to delete, and you must 
explicitly confirm before any permanent deletion happens.

### Can I undo a deletion?

No. Deletion is permanent once confirmed, which is why the plugin requires an explicit
confirmation step (and optionally typing “DELETE”) before removing files. Always
back up your site before bulk-deleting media.

### Will this slow down my site?

The plugin only loads its code on its own admin pages and during the AJAX requests
you trigger by clicking “Start Scan.” It has no effect on front-end page load times.

### Does it work with ACF (Advanced Custom Fields)?

Yes. If ACF is detected as active, the plugin includes an additional check for media
referenced inside ACF field values.

### What happens to a file’s scan result after I delete it?

The corresponding row is removed from the plugin’s own results table immediately
after a successful deletion.

### How does the duplicate finder decide what’s a duplicate?

It hashes the actual file contents (MD5), so two files only match if their bytes
are identical — filename and upload date don’t matter. The plugin always keeps at
least one copy from every duplicate group, even if you select all of them for deletion.

### Will scheduled scans work on any host?

Scheduled scans rely on WordPress’s built-in cron, which only fires on a site visit.
On low-traffic sites this can mean delayed runs; for reliable timing, point a real
server cron job at `wp-cron.php` as you would for any other WordPress scheduled 
task.

## 评价

此插件暂无评价。

## 贡献者及开发者

「HK Media Optimizer」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Harikrut Technolab ](https://profiles.wordpress.org/harikrut/)

[帮助将「HK Media Optimizer」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/hk-media-optimizer)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/hk-media-optimizer/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/hk-media-optimizer/)，或通过[RSS](https://plugins.trac.wordpress.org/log/hk-media-optimizer/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/hk-media-optimizer/)。

## 更新日志

#### 1.0.0

 * Initial release.

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**1 周前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.8 或更高版本 **
 *  已测试的最高版本为 **7.0.2**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/hk-media-optimizer/)
 * 标签
 * [delete unused images](https://cn.wordpress.org/plugins/tags/delete-unused-images/)
   [media optimizer](https://cn.wordpress.org/plugins/tags/media-optimizer/)[unused media](https://cn.wordpress.org/plugins/tags/unused-media/)
 *  [高级视图](https://cn.wordpress.org/plugins/hk-media-optimizer/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/hk-media-optimizer/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/hk-media-optimizer/reviews/)

## 贡献者

 *   [ Harikrut Technolab ](https://profiles.wordpress.org/harikrut/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/hk-media-optimizer/)