Because Slack comes with limited file storage and there's no way to bulk delete files in order to free up space. (Source)
$ npm install -g slack-delete-files
Instead of polluting global installs, you can also run the Node binary directly:
$ npx slack-delete-files
$ slack-delete-files Options: --help Show help [boolean] --version Show version number [boolean] --token, -t Slack token [string] [required] --pinned Include pinned files [boolean] [default: false] --max Amount of files to fetch [number] [default: 1000] --age Delete only files older than the specified number of days [number] [default: 30]
A Slack API token (
--token) is required! Grab yours in Slack API docs.
Below, we are deleting files older than 60 days, including pinned files.
slack-delete-files --age=60 --pinned --token=xoxp-34874354-4059649056
- Does NOT delete files sent in people's private channels.