Uploaded/pasted images not removed when page is removed #5563

Closed
opened 2026-02-05 10:10:27 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @dotdeas on GitHub (Jan 7, 2026).

Describe the Bug

Uploaded images that has been pasted into a page in the wysiwyg editor are not deleted from the /public/uploads/images/gallery/ folder when the page it's used on is deleted and the trashcan is emptied.

Steps to Reproduce

  1. Create a new page
  2. Paste a image into the wysiwyg editor
  3. Save the page
  4. Delete the page
  5. Empty the trashcan
  6. Image still exists in the filestructure

Expected Behaviour

When a page is removed, all linked images that has been pasted using the wysiwyg editor should also be removed

Screenshots or Additional Context

No response

Browser Details

Latest Safari and Edge on macOS

Exact BookStack Version

v25.12.1

Originally created by @dotdeas on GitHub (Jan 7, 2026). ### Describe the Bug Uploaded images that has been pasted into a page in the wysiwyg editor are not deleted from the /public/uploads/images/gallery/ folder when the page it's used on is deleted and the trashcan is emptied. ### Steps to Reproduce 1. Create a new page 2. Paste a image into the wysiwyg editor 3. Save the page 4. Delete the page 5. Empty the trashcan 6. Image still exists in the filestructure ### Expected Behaviour When a page is removed, all linked images that has been pasted using the wysiwyg editor should also be removed ### Screenshots or Additional Context _No response_ ### Browser Details Latest Safari and Edge on macOS ### Exact BookStack Version v25.12.1
OVERLORD added the 🐛 Bug label 2026-02-05 10:10:27 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 8, 2026):

Hi @dotdeas,
Thanks for reporting but this is expected.
Images will remain in the event they are used elsewhere (since it's easy for this to occur).
There's a maintenance option to detect & delete unused images, which can help with management.

Recently I've been thinking on a more advanced image reference tracking system to watch where images are used, to be able to provide better permission control and auto-deletion handling, but I'm not sure if/when that'll be developed out soon.

@ssddanbrown commented on GitHub (Jan 8, 2026): Hi @dotdeas, Thanks for reporting but this is expected. Images will remain in the event they are used elsewhere (since it's easy for this to occur). There's a maintenance option to detect & delete unused images, which can help with management. Recently I've been thinking on a more advanced image reference tracking system to watch where images are used, to be able to provide better permission control and auto-deletion handling, but I'm not sure if/when that'll be developed out soon.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5563