Title: CoffeeWP Media Cleanup &#8211; Scan and Remove Unused Media and Orphan Thumbnails
Author: Eli Hanna
Published: <strong>2026年6月1日</strong>
Last modified: 2026年10月4日

---

プラグインを検索

![](https://ps.w.org/coffeewp-media-cleanup/assets/banner-772x250.png?rev=3727670)

![](https://ps.w.org/coffeewp-media-cleanup/assets/icon-256x256.png?rev=3586640)

# CoffeeWP Media Cleanup – Scan and Remove Unused Media and Orphan Thumbnails

 作者: [Eli Hanna](https://profiles.wordpress.org/eliehanna/)

[ダウンロード](https://downloads.wordpress.org/plugin/coffeewp-media-cleanup.1.3.5.zip)

 * [詳細](https://ja.wordpress.org/plugins/coffeewp-media-cleanup/#description)
 * [レビュー](https://ja.wordpress.org/plugins/coffeewp-media-cleanup/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/coffeewp-media-cleanup/#installation)
 * [開発](https://ja.wordpress.org/plugins/coffeewp-media-cleanup/#developers)

 [サポート](https://wordpress.org/support/plugin/coffeewp-media-cleanup/)

## 説明

CoffeeWP Media Cleanup helps you reclaim disk space and tidy up your WordPress media
library.

A guided three-step wizard walks you through the work:

 1. **Pre-scan settings**: review detected page-builder compatibility, pick which thumbnail
    sizes WordPress should generate, and choose a batch size that fits your server.
 2. **Scan**: walk your uploads tree and detect which files are unused, broken, or 
    missing.
 3. **Results**: see what is unused, what is broken, what is missing, which thumbnails
    are stale, and run targeted clean actions on selected rows or across the whole 
    result set.

**Clean actions:**

 * Delete unused media (file moves to trash; attachment record soft-deleted).
 * Delete missing files (clears DB rows whose backing file is gone).
 * Delete broken-link records (clears attachment posts whose files never existed).
 * Delete orphan thumbnails (removes derivative files with no attachment parent).
 * Regenerate missing thumbnails (re-runs WordPress’s image-size pipeline).
 * Add orphan files to the Media Library (creates attachment records for unattached
   files).

**Trash + restore:**

A dedicated Trash view lists every file the plugin has moved out. Restore any item
with one click, permanently delete individual rows, or empty the trash. Optional
auto-delete after N days. Trashed files live under `wp-content/uploads/cwpm/trash/`
and are protected from being overwritten by new uploads (filename collisions are
detected and avoided).

**Activity log:**

Every clean action writes to a daily log file at `wp-content/uploads/cwpm/logs/`.
The Logs view shows each file with size and download link. Optional auto-delete 
after 30 days.

**Designed to be safe:**

 * Soft-delete by default. No file is ever permanently removed except via the explicit“
   Empty trash” or “Permanent delete” controls.
 * Per-row checkboxes and a typed-confirmation disclaimer modal gate the destructive
   actions.

**CoffeeWP Media Cleanup PRO**

A paid version extends the scanner to places the free version does not reach:

 * Scan any custom post type, beyond posts, pages, and WooCommerce products.
 * Find duplicate files by content hash.
 * Deeper WooCommerce scanning: product galleries, variation images, and
    downloadable
   files.
 * Elementor deep parsing for images stored in builder data.

Details and pricing: https://coffeewp.dev/media-cleanup/

### External Services

This plugin does not connect to any external services. No data leaves your WordPress
install.

### Third-Party Libraries

The plugin bundles these GPL-compatible libraries (LICENSE files shipped alongside
each):

 * **Color Punch** (MIT): internal CSS / JS UI framework. Shipped at `assets/vendor/
   color-punch/`.
 * **Font Awesome Free** (CC BY 4.0 icons + SIL OFL 1.1 fonts + MIT code): icon 
   font. Shipped at `assets/vendor/font-awesome/`. Upstream: https://fontawesome.
   com/
 * **Rubik**, **Outfit**, **Fira Code** fonts (SIL OFL 1.1): bundled with Color 
   Punch under `assets/vendor/color-punch/fonts/`.
 * **Catppuccin** color palette (MIT): applied via Color Punch theme variants. Upstream:
   https://github.com/catppuccin/catppuccin

### Data + Storage

**Custom database tables** (created on activation, dropped only on uninstall when`
cwpm_delete_data_on_uninstall` is enabled):

 * `wp_cwpm_scan_results`: per-file scan output (rel_path, attachment_id, usage 
   flags, thumbnail status).
 * `wp_cwpm_trash`: trashed-file ledger (rel_path, original_path, file_name, file_size,
   trashed_at).
 * `wp_cwpm_file_hashes`: md5 hashes computed during scan; reserved for future identity-
   matching features.

**On-disk storage** (under `wp-content/uploads/cwpm/`):

 * `wp-content/uploads/cwpm/trash/`: files moved by the trash system. Recoverable
   until you Permanent-Delete or Empty-Trash.
 * `wp-content/uploads/cwpm/logs/`: daily activity logs (one file per day, e.g. `
   cwpm-2026-05-13.log`).

Both folders contain `.htaccess` + `index.php` stubs to prevent direct web access.

**Options + transients:** all keys start with `cwpm_`. Stored in `wp_options`. Per-
user preferences (theme, table density) stored in `wp_usermeta` with the same prefix.

**Custom post type:** `cwpm-trash`: used as a soft-delete state for attachment posts.
The attachment record stays in `wp_posts` but is hidden from the Media Library until
restored.

## スクリーンショット

[⌊Pre-scan settings step: pick thumbnail sizes, set batch size, see detected plugin
compatibility (ACF, WooCommerce, page builders).⌉⌊Pre-scan settings step: pick thumbnail
sizes, set batch size, see detected plugin compatibility (ACF, WooCommerce, page
builders).⌉[

Pre-scan settings step: pick thumbnail sizes, set batch size, see detected plugin
compatibility (ACF, WooCommerce, page builders).

[⌊Scan step: live progress as the wizard walks the uploads tree.⌉⌊Scan step: live
progress as the wizard walks the uploads tree.⌉[

Scan step: live progress as the wizard walks the uploads tree.

[⌊Results step: stats grid, sortable / filterable table, batch action bar.⌉⌊Results
step: stats grid, sortable / filterable table, batch action bar.⌉[

Results step: stats grid, sortable / filterable table, batch action bar.

[⌊Clean complete: summary modal showing how many files were trashed and how much
space was freed.⌉⌊Clean complete: summary modal showing how many files were trashed
and how much space was freed.⌉[

Clean complete: summary modal showing how many files were trashed and how much space
was freed.

[⌊Trash view: listing of moved files with restore + permanent-delete controls.⌉⌊
Trash view: listing of moved files with restore + permanent-delete controls.⌉[

Trash view: listing of moved files with restore + permanent-delete controls.

## インストール

 1. Upload the plugin folder to `/wp-content/plugins/coffeewp-media-cleanup/`, or install
    from the WordPress Plugins screen.
 2. Activate **CoffeeWP Media Cleanup** from the Plugins screen.
 3. Open **Media Cleanup** in the WordPress admin sidebar.
 4. Step through Pre-scan settings  Scan  Results. The first scan may take several 
    minutes on large libraries; the wizard reports progress and resumes if your browser
    times out.

## FAQ

### Does this plugin modify original media files?

No. Originals are never altered. Files marked unused are moved to `wp-content/uploads/
cwpm/trash/` and can be restored. Cleanup actions only remove derivative thumbnails
or trash unused files.

### What happens when I delete an “unused” file?

The file moves to `wp-content/uploads/cwpm/trash/<year>/<month>/<filename>` and 
the attachment’s `post_type` changes to `cwpm-trash` (it disappears from the Media
Library but still exists in the database). Restore from the Trash view to undo. 
Permanent delete only happens via “Empty trash”, “Permanent delete” on a single 
row, or the auto-delete-after-N-days setting if you enable it.

### How is “unused” detected?

The scanner inspects post content (including Gutenberg blocks, the classic editor,
post excerpts), post meta (serialized + JSON arrays), Advanced Custom Fields image,
file, gallery, and WYSIWYG fields (including values nested in repeater, flexible
content, group, and clone fields), widget content, theme support (custom logo, site
icon, background image), and `wp-image-N` CSS classes. WPML / Polylang translations
resolve back to the original attachment. Posts and pages are scanned by default,
plus WooCommerce products when WooCommerce is active; images used only on other 
post types are not detected as in-use.

### Will it slow down my site?

The scanner runs only when you trigger it from the admin wizard. No work happens
on the public site or in cron. Each scan request is batched (default 50 files per
request) to stay within typical PHP execution limits; the batch size is configurable.

### Will deleting the plugin remove all my data?

By default, no. Uninstalling the plugin from the Plugins screen preserves the custom
tables, options, and the `wp-content/uploads/cwpm/` folder so an accidental delete
is recoverable. A settings toggle for full teardown on uninstall is planned; until
then the `cwpm_delete_data_on_uninstall` option can be set to `true` programmatically.

## 評価

このプラグインにはレビューがありません。

## 貢献者と開発者

CoffeeWP Media Cleanup – Scan and Remove Unused Media and Orphan Thumbnails はオープン
ソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

 *   [ Eli Hanna ](https://profiles.wordpress.org/eliehanna/)

[“CoffeeWP Media Cleanup – Scan and Remove Unused Media and Orphan Thumbnails” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/coffeewp-media-cleanup)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/coffeewp-media-cleanup/)
するか、[SVN リポジトリ](https://plugins.svn.wordpress.org/coffeewp-media-cleanup/)
をチェックするか、[開発ログ](https://plugins.trac.wordpress.org/log/coffeewp-media-cleanup/)
を [RSS](https://plugins.trac.wordpress.org/log/coffeewp-media-cleanup/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 1.3.5

 * Fixed a fatal error that could take down the admin when another CoffeeWP plugin
   was active alongside this one.
 * The promo band and its assets now load only on the plugin’s own screen.

#### 1.3.4

 * WooCommerce products are now scanned for media usage when WooCommerce is active.
 * The compatibility notice now explains what each plugin’s scan covers.

#### 1.3.3

 * Update plugin assets.

#### 1.3.2

 * First public release.

## メタ

 *  バージョン **1.3.5**
 *  最終更新日 **1か月前**
 *  有効インストール数 **10未満**
 *  WordPress バージョン ** 5.8またはそれ以降 **
 *  検証済み最新バージョン: **7.1.4**
 *  PHP バージョン ** 7.4またはそれ以降 **
 *  言語
 * [English (US)](https://wordpress.org/plugins/coffeewp-media-cleanup/)
 * タグ
 * [attachments](https://ja.wordpress.org/plugins/tags/attachments/)[cleanup](https://ja.wordpress.org/plugins/tags/cleanup/)
   [media](https://ja.wordpress.org/plugins/tags/media/)[optimization](https://ja.wordpress.org/plugins/tags/optimization/)
   [thumbnails](https://ja.wordpress.org/plugins/tags/thumbnails/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/coffeewp-media-cleanup/advanced/)

## 評価

レビューはまだ送信されていません。

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

[すべてのレビューを見る](https://wordpress.org/support/plugin/coffeewp-media-cleanup/reviews/)

## 貢献者

 *   [ Eli Hanna ](https://profiles.wordpress.org/eliehanna/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/coffeewp-media-cleanup/)