Deleted Attachments and the Recycle Bin

Last modified by Eleni Cojocariu on 2026/09/18 15:29

Reference

An attachment deleted from a Page is not thrown away. XWiki moves it to the attachment recycle bin, a bin of its own beside the one deleted Pages go to, which is what lets an older version of a Page keep the files it had and what restoring a deleted attachment takes it back from. Attachments introduces the other choices an administrator makes about an attachment.

Where deleted attachments are listed

Everything in the bin is listed on one page of the wiki, which an administrator reaches directly:

http://<yourwiki>/xwiki/bin/view/XWiki/DeletedAttachments

Each row gives the file, the Page it was attached to, when it was deleted and by whom, and one action: deleting it for good.

deleted-attachments-index.png

The listing has no action for putting a file back, in any version to date. An attachment comes back through the Page it belonged to, by rolling that Page back to a version from before the deletion.

How long before an attachment can be deleted for good

A file cannot be purged from the bin the moment it lands there, which leaves a window in which a deletion is still reversible. Two properties of xwiki/WEB-INF/xwiki.cfg set that window, and they are not attachment settings: XWiki reads the same two for deleted Pages.

PropertyDefaultWho waits that long
xwiki.store.recyclebin.adminWaitDays0An administrator, who may therefore purge straight away.
xwiki.store.recyclebin.waitDays7Everyone else, who also needs the Delete right on the Page the file came from.

Neither line ships in xwiki.cfg, so using them means adding them. Both are read at startup, so a change takes effect on the next restart. This is what makes everyone, administrators included, wait three days:

xwiki.store.recyclebin.adminWaitDays=3
xwiki.store.recyclebin.waitDays=3

Until the wait is over, the row is listed without its delete action, so nobody can purge the file early by going round the listing.

Optional Store Features is where the attachment recycle bin is switched off altogether, and where the store that holds what it keeps is chosen.

FAQ

When does the wait start?

At the deletion, the moment the "Deleted on" column shows. A value is read as a number of days and may have a fraction, so 0.5 is a wait of twelve hours.

Why is a file missing from the listing?

Either the attachment recycle bin is switched off on that wiki, in which case a deleted attachment is dropped instead of kept, or the file has already been purged.

Related

Get Connected