Audit & Diagnostics Custom Skills · Curated

Orphaned Media Cleaner

Finds media library files that no longer appear anywhere on the site.

What it does

Cross-references every attachment in the media library against post content, postmeta (featured images, ACF fields), widgets, customizer settings, and theme template references, then flags files with zero matches as candidates for cleanup. Files are only ever listed for review, never deleted automatically.

Install

This skill isn't packaged in an installable registry. It's a plain SKILL.md file you can copy directly. Copy it from the SKILL.md tab and save it at the path for your assistant:

Use it in your AI assistant

Claude Code

.claude/skills/orphaned-media-cleaner/ (or ~/.claude/skills/orphaned-media-cleaner/ for all projects)

GitHub Copilot (VS Code)

.github/skills/orphaned-media-cleaner/

OpenAI Codex

.codex/skills/orphaned-media-cleaner/

Cursor

.cursor/skills/orphaned-media-cleaner/ (or ~/.cursor/skills/orphaned-media-cleaner/ globally)

Compatibility

Any WordPress site; needs file system and database access, ideally via WP-CLI, to cross-check attachment usage against content.