๐Ÿ–ผ๏ธ Media Management

April 11, 2026 ยท View on GitHub

Ketesa provides granular media controls at the file, user, and room level โ€” useful for content moderation and storage management. You can quarantine harmful content, protect important media from accidental quarantine, delete individual files or entire user libraries, and purge the remote media cache.


๐Ÿ—‚๏ธ Concepts

OperationWhat it doesReversible?
QuarantineBlocks access to the media for all usersโœ… Yes (unquarantine)
ProtectPrevents the media from being quarantinedโœ… Yes (unprotect)
DeletePermanently removes the media from the serverโŒ No
Purge remote cacheRemoves locally cached copies of media fetched from remote serversโŒ No

๐Ÿ“ Quarantine and protect are mutually exclusive states for a single file. A protected file cannot be quarantined, and an already-quarantined file cannot be protected until it is first unquarantined.


๐Ÿ“„ Per-file Operations

Per-file actions are available in two places:

  • User edit page โ†’ Media tab โ€” shows all media uploaded by the user, with per-row action buttons
  • Room show page โ†’ Media tab โ€” shows all media uploaded into the room, with a per-row delete button

The following buttons appear on each file row in the user Media tab:

Button labelWhat it doesWhen it appears
QuarantineQuarantines the file, blocking all accessFile is not protected and not already quarantined
UnquarantineLifts the quarantine on the fileFile is currently quarantined
ProtectMarks the file as safe from quarantineFile is not quarantined and not already protected
UnprotectRemoves the protection flagFile is currently protected
DeletePermanently deletes the individual fileAlways visible

๐Ÿ“ The quarantine button is replaced by a disabled "Protected" indicator when the file is safe from quarantine. The protect button is replaced by a disabled "In quarantine" indicator when the file is already quarantined.


๐Ÿ‘ค Per-user Operations

Location: Users โ†’ select a user โ†’ Edit โ†’ Media tab

The Media tab on the user edit page shows all media uploaded by that user, with per-file action buttons (see Per-file Operations above).

At the top of the tab, bulk action buttons are available:

Button labelWhat it doesWhen it appears
Quarantine all mediaQuarantines every media file uploaded by the user, after confirmationAlways visible
Delete all mediaPermanently deletes every media file uploaded by the user, after confirmationAlways visible

โš ๏ธ Quarantine all media affects every file the user has ever uploaded to the server. This cannot be undone in bulk โ€” you would need to unquarantine each file individually. Use with care.

โš ๏ธ Delete all media permanently removes all media uploaded by the user. This cannot be undone. The dialog runs in the foreground โ€” do not close it until deletion is complete.


๐Ÿšช Per-room Operations

Location: Rooms โ†’ select a room โ†’ Show โ†’ Media tab

The Media tab on the room show page lists all media uploaded into that room. Each row has an individual Delete button.

At the top of the tab, bulk action buttons are available:

Button labelWhat it doesWhen it appears
Quarantine all mediaQuarantines every media file uploaded in the room, after confirmationAlways visible
Delete all mediaPermanently deletes all local media in the room, after confirmationOnly for unencrypted rooms

โš ๏ธ Quarantine all media affects all files uploaded to the room by all members. Use this for rooms with reported illegal or harmful content.

โš ๏ธ Delete all media permanently removes all local media in the room. Only local media from unencrypted rooms is affected โ€” media from external servers and encrypted rooms is excluded. The dialog runs in the foreground and shows live progress โ€” do not close it until deletion is complete.

๐Ÿ“ It is not possible to delete media that has been uploaded to external media repositories. Only media hosted on your own server is affected.


๐ŸŒ Purge Remote Media Cache

Location: Statistics โ†’ Users' media โ†’ toolbar โ†’ Purge remote media button

When your server federates with other Matrix homeservers, it caches copies of media (avatars, images, files) from those remote servers. Over time this cache can grow large. The purge remote media action removes these locally cached copies.

๐Ÿ“ This action only affects your server's local cache of remote media. It does not affect media uploaded to your own server's media repository, and does not delete the originals from their source servers. Remote users can re-fetch media after a purge.

Dialog options:

FieldDescription
last access beforeOnly purge remote media that has not been accessed since this date/time. Leave at the default (epoch) to purge all cached remote media.

๐Ÿ—‘๏ธ Delete Local Media

Location: Statistics โ†’ Users' media โ†’ toolbar โ†’ Delete media button

This action deletes local media from your server's disk, including thumbnails and downloaded copies of remote media. It does not affect media uploaded to external media repositories.

Dialog options:

FieldDescription
last access beforeOnly delete media that has not been accessed since this date/time
Larger than (in bytes)Only delete media files larger than this size. Step size is 1024 bytes.
Keep profile imagesWhen enabled, profile avatars are excluded from deletion (default: on)

โš ๏ธ Deleted media cannot be recovered. Files that match all specified criteria are removed permanently from disk.


๐Ÿ”’ How to Quarantine a File

  1. Navigate to Users and open the user who uploaded the file.
  2. Click Edit, then open the Media tab.
  3. Find the file in the list. The Quarantine button appears on rows where the file is not protected and not already quarantined.
  4. Click Quarantine. The button changes to Unquarantine immediately on success.

๐Ÿ’ก To undo, click the Unquarantine button on the same row.


๐Ÿ›ก๏ธ How to Protect Media from Accidental Quarantine

  1. Navigate to Users and open the user who uploaded the file.
  2. Click Edit, then open the Media tab.
  3. Find the file in the list. The Protect button appears on rows where the file is not quarantined and not already protected.
  4. Click Protect. The button changes to Unprotect immediately on success.

๐Ÿ’ก A protected file cannot be quarantined โ€” the quarantine button is replaced by a disabled "Protected" indicator. To remove protection later, click Unprotect.


๐Ÿ—‘๏ธ How to Delete All Media for a User

โš ๏ธ Deletion is irreversible. All files are permanently removed from disk. There is no undo.

Single user:

  1. Navigate to Users and open the user.
  2. Click Edit, then open the Media tab.
  3. Click Delete all media at the top of the tab.
  4. Confirm in the dialog. The dialog runs in the foreground โ€” do not close it until complete.

Multiple users at once (bulk):

  1. Navigate to Users.
  2. Select the users using the checkboxes on the left.
  3. Click Delete all media in the bulk action toolbar that appears at the top.
  4. Confirm in the dialog. A summary notification reports how many succeeded and how many failed.

Server-wide delete by age/size (Statistics):

The Delete media button (found in Statistics โ†’ Users' media toolbar) deletes media server-wide based on age and size filters:

  1. Navigate to Statistics โ†’ Users' media.
  2. Click Delete media in the top toolbar.
  3. Set a last access before date to target old unused files.
  4. Optionally set a Larger then (in bytes) threshold to target large files only.
  5. Toggle Keep profile images off if you also want to remove avatars.
  6. Click Delete media to confirm.

๐Ÿ’ก Run with conservative filters first (e.g., a recent cutoff date and large size threshold) to limit the blast radius before doing a broad sweep.


๐Ÿšช How to Delete All Media for a Room

โš ๏ธ Only local media from unencrypted rooms is affected. Media from encrypted rooms and external servers is excluded. Deletion is irreversible.

Single room:

  1. Navigate to Rooms and open an unencrypted room.
  2. Click Show, then open the Media tab.
  3. Click Delete all media at the top of the tab.
  4. Confirm in the dialog. The dialog shows live progress and runs in the foreground โ€” do not close it until complete.

Multiple rooms at once (bulk):

  1. Navigate to Rooms.
  2. Select the rooms using the checkboxes on the left.
  3. Click Delete all media in the bulk action toolbar that appears at the top.
  4. Confirm in the dialog. Encrypted rooms are skipped automatically. A summary notification reports the result.

See also: User management ยท Room management ยท Server statistics ยท Documentation index