Product Trash — Complete guide
Install, configure and use the product trash: automatic backup before deletion, identical restore with the original ID, image file copy, automatic retention and best practices for PrestaShop 8 and 9.
Overview
The Product Trash module turns every product deletion into a reversible backup. Right before a product is erased — manually, in a bulk action, by an import or by a script — the module takes a complete snapshot and places it in a trash bin. You can then restore the product identically in one click, with its original ID, which preserves its URLs and SEO.
The capture covers the database data (record, translations, combinations, prices, stock, categories, features, etc.) as well as the image files on disk. The module is compatible with PrestaShop 8 and 9, on single and multistore, and multilingual.
Installation
- From the back office, open Modules > Module Manager.
- Click Upload a module and drop the module’s ZIP archive.
- Once installation is complete, click Configure.
On installation, the module creates a dedicated backup table, a protected backup folder for images, and a new Product trash tab in the Catalog menu. Deletion monitoring is active immediately, with no prior configuration.
Accessing the trash
The trash is reachable two ways: via the Catalog > Product trash menu, or via the Open the trash button on the module’s configuration page. The list shows backed-up products not yet restored, with their original product ID, name, reference, number of backed-up images, who deleted it and when.
How the backup works
The module hooks into actionObjectProductDeleteBefore, fired by PrestaShop just before a product is erased, at the moment when all its data is still present in the database. This hook is used by both the legacy product page and the new Symfony page of PrestaShop 8 and 9, as well as by bulk deletions: every deleted product is therefore backed up individually.
The captured snapshot includes:
- the product record, its per-shop versions and its translations for every language;
- combinations, their attributes and their per-shop versions;
- specific prices, stock and category links;
- features, tags, suppliers and carriers;
- attachments, related products, packs and downloadable virtual products;
- customization fields and their translations;
- image files, in every generated size, copied to a protected backup folder.
The capture is silent and never blocks the deletion. If a backup step fails for any reason, PrestaShop carries on with the deletion normally: the module does not disrupt the store’s operation.
Restoring a product
- Open Catalog > Product trash.
- Find the product to restore in the list (you can filter and sort the columns).
- Click the green Restore button and confirm.
The module then re-inserts all linked tables in a single transaction, keeping the original IDs, copies the image files back to their exact location, then reruns search indexing. The product reappears in your catalogue just as it was before deletion, and its entry disappears from the trash. The description HTML is preserved character for character.
Anti-conflict. The restore first checks that the product ID is free. If another product already uses that ID, the restore is cancelled and a message tells you so, to never overwrite an existing record. In practice, PrestaShop does not reuse deleted IDs, so this case is rare.
Permanent deletion and emptying the trash
To free up space, you can permanently delete a single backup with the red button in the Actions column. This removes the snapshot and the associated image files; it is irreversible.
The Empty trash button, at the top of the list, permanently deletes all non-restored backups in a single operation.
Configuration
Back up image files
When this option is enabled (default), the module copies the image files in every size on deletion and puts them back on restore. Disable it if you want to back up data only and save disk space; in that case, the image rows remain in the snapshot but the files are not restored.
Retention (days)
Set the number of days after which backups are purged automatically. The value 0 keeps backups with no time limit. The purge runs as further deletions occur.
Multistore and multilingual
The snapshot captures every language and every shop associated with the product, and the restore puts them all back. The module works on a single shop as well as on a PrestaShop multistore.
Best practices and edge cases
- Large catalogues: every deletion creates a backup. Set a suitable retention to avoid needless accumulation if you frequently delete many products (replacement imports, for example).
- Backup folder: it is protected by an
.htaccessand anindex.php, so it is not publicly accessible. It must remain writable by the server. - Imports: an import that deletes then recreates products fills the trash with the deleted versions. This is intentional and useful in case of a failed import; remember to empty the trash once the import is validated.
Uninstallation
Uninstalling the module removes the backup table, the menu tab and the entire backup folder (snapshots and image files). Products already restored and present in the catalogue are not affected.
FAQ
Does the trash work with bulk deletion and the new product page?
Yes. The capture relies on a hook used by the legacy product page, the new Symfony page of PrestaShop 8 and 9, and bulk deletions. Every deleted product is backed up individually.
Does the restore keep the same product ID?
Yes. The product is restored with its original ID, which preserves its URLs, its redirects and its SEO. If the ID is already taken, the restore is blocked.
Are images restored, files included?
Yes, when the image backup option is enabled. Files in every size are copied on deletion and put back on restore, then search is reindexed.
Is the module compatible with PrestaShop 9?
Yes, the module is compatible with PrestaShop 8.x and 9.x, on single and multistore.