Purge Trash Script

Last Updated: 20 Jan 2018

The purge_trash.php script located in the /scripts directory allows you to purge the trash using the command line as opposed to the Purge Trash function within the Admin interface. It can be added to the system crontab and automatically run at regular intervals to purge the system trash.


  • [SYSTEM ROOT] - The Matrix system's root directory.
  • [PURGE ROOTNODE] (optional) - The root node of the Trash you want to purge. If an asset ID is provided, only this asset and its child assets will be purged instead of the entire trash. If it is omitted, the entire trash will be purged.


$ sudo -u 'apache' php scripts/purge_trash.php $(pwd) 20447
[2018-01-20 20:24:11] 0 / 10 (0%)
[2018-01-20 20:24:16] 10 / 10 (100%)

Previous Chapter Next Chapter

The Latest

Let Us Know What You Think

Let us know if you spot any errors or if you have any ideas on how we can improve the Matrix Community Website.

Contact Squiz for Demo

Let us show you the true power of Squiz Matrix by giving you a personalised demonstration.