Deleting a file from emDash's media library is permanent. There is no trash, and emDash doesn't touch the articles that still point at the file, so every one of them shows a broken image. The protection emDash offers is a view called Used in, which lists the entries that refer to a file before you delete it.
It is a good feature with sharp edges. It only sees certain kinds of references, it only works once tracking has finished indexing, and on this site that indexing sat unfinished for six days because nobody had the right page open. Here is how to read it, and when not to trust it.
What Used in checks
Open a file in the media library and select Used in. emDash lists each entry that refers to it, with the collection and the field, and a link to open the entry. It also shows whether the file is the site's logo, favicon or default social image.
| Checked | Not checked |
|---|---|
| Image and file fields, including inside repeaters and blocks fields | Custom rich text blocks, such as a card or a callout with an image |
| Image, gallery and video blocks in rich text | Menus and widgets |
| The logo, favicon and default social image | Plugin data and other settings |
| Entries in the trash, marked as such | Your templates and code, other sites, newsletters and social posts that link to the file |
The right-hand column matters. A theme that hard-codes a hero image, a widget with a logo, or a newsletter that linked to a chart will all break when the file goes, and Used in won't have warned you. emDash's own documentation says plainly that an empty list doesn't prove a deletion is safe.
Read the status before the list
Under the list, Used in reports how complete its information is. There are seven states:
- Complete. Every collection has been indexed and is current. Only in this state does an empty list mean "no tracked references found".
- Never. No collection has been indexed yet. Tracking may not even be switched on.
- Running. Indexing is in progress.
- Partial. Some collections are indexed, others aren't.
- Stale. The index is older than the content it describes.
- Failed. Indexing failed.
- Unknown. The stored state isn't recognised by this version of emDash.
In every state except complete, an empty list reads "No usage to show yet". That is emDash saying it doesn't know, not that nothing uses the file.
The count is also hidden from people who can't read drafts, because it could reveal unpublished content. A Contributor sees the file but not where it is used.
Turning tracking on, and why ours stalled
Tracking is switched on once per site, by an administrator, under Settings, then Media usage tracking. It can't be switched off afterwards. It runs in two stages:
- Setting up. emDash prepares each collection so future saves record their media. While this runs, it refuses content, schema, revision, import and MCP writes, so pause editors, scripts and agents first.
- Indexing existing content. Editing resumes and emDash scans the entries that already existed. The documentation says to keep the settings page open while this happens.
That second instruction is not a suggestion. In emDash 1.4.0 the scan advances only through requests that the settings page itself sends while it is open; nothing in the background picks it up. On this site, posts and pages sat in the queue from 24 October with no attempts at all. When an administrator opened the page on 30 October, all nine collections finished in about two minutes.
So after switching tracking on, stay on the page until every collection says ready. If you left too early, go back: the scan continues from where it stopped.
A gap in 1.4.0: images written by agents and scripts
Rich text written as Markdown, through the MCP server or the command line, stores an image as a plain address rather than a link to the media library item. emDash 1.4.0 doesn't recognise those addresses, so an image added that way is missing from Used in.
The same happens when an agent reads an article as Markdown and writes it back. As our guide to AI agents describes, the round trip drops the media library link from every image, so images that were tracked stop being tracked.
The fix is already merged into emDash and the documentation describes the new behaviour, but it is not in 1.4.0. Until the next release, have agents write Portable Text for anything with images, and don't rely on Used in for images an agent or script inserted.
Repairing the index
After an import, a script that wrote to the database directly, or a restore from backup, the index can be out of date. An administrator can rebuild it from the command line:
npx emdash media repair-usage --collection postsnpx emdash media repair-usage --all --json
Repair one collection when you know which one changed; repairing everything runs in one go and can be slow on a large site. A run can finish "successfully" with a partial or stale result, so automation should read the status in the JSON output rather than trust the exit code.
How WordPress handles the same problem
WordPress itself
WordPress has the same core risk. Deleting a file from its media library removes it permanently by default, and the posts that used it show broken images. WordPress does have a media trash, but it is switched off unless a developer turns it on in the site's configuration. Most sites never do.
WordPress also has no equivalent of Used in. The media list's "Uploaded to" column looks like one, but it only shows the post a file was first uploaded to:
- A file uploaded with one article and reused in ten others still shows only the first.
- A file uploaded on its own shows nothing at all.
On a plain WordPress site, checking before you delete means searching your content by hand.
Plugins that fill the gap
Two popular plugins come closest:
- Media Library Assistant (over 70,000 active installs) reports where items are used, including which galleries show them. Its own FAQ warns that this is heavy on the database, and offers settings to switch parts of it off or cache the results.
- Media Cleaner (over 90,000 active installs) scans the site for media that content doesn't use. A References tab explains why each file was kept, and deleted files go to the plugin's own trash first, so a mistake can be undone. Support for page builders and custom-field plugins is in the paid Pro version.
Media Cleaner's documentation also carries a warning very close to emDash's own: a file "not found in content" may still be used by a page builder, a template or another site. Every tool that tracks usage has the same blind spot, because none of them can see code and other websites.
| Before deleting a file | emDash 1.4 | WordPress core | WordPress with a plugin |
|---|---|---|---|
| See where it is used | Built in, kept current on every save | No; only the post it was uploaded to | Yes, computed when you look or scan |
| Know how complete the answer is | Yes, a coverage status | No | A warning about dynamic uses |
| Undo a deletion | No; restore from backup | Only if a developer enables the media trash | Yes, with Media Cleaner's own trash |
| Sees templates, builders and other sites | No | No | Page builders with paid versions; never code or other sites |
So emDash has built in what WordPress sites install a plugin for, and its index stays current instead of being worked out on demand. What it lacks is the safety net: there is no media trash at all. On emDash, the backup of your media bucket is your undo button.
Keeping your media library tidy without breaking pages
- Running an emDash site yourself. Switch tracking on, keep the settings page open until it is ready, and make Used in a habit before every deletion. When in doubt, leave the file: storage is cheap and broken images aren't.
- Evaluating emDash. Usage tracking with honest coverage states is better than most CMSs offer. Know its blind spots: custom blocks, menus, widgets and anything outside the database.
- Running an agency. Switch tracking on as part of every launch, and document which custom blocks and templates hold images, because the client's Used in view won't show them.




