Slack is the tool of choice for many companies and companies that collaborate remotely. It is a productivity powerhouse that encompasses chat, file sharing, project management tools, and a wide range of plugins that offer a lot of power to the application. What typically happens within a Slack group is a lot of files being shared with little version control and a lot of mess to clean up once the project is complete. If you’re cleaning up after such a project, here’s how to delete all your Slack files without deleting the workspace.
Slack saves everything. As long as your workspace is active, all your files, channels, chats, and everything you’ve shared will be preserved. You could archive or delete a workspace, but since it takes a bit of time to set up and break down, if you plan to get the team back together for another project, it may not be worth it. It’s much better to do a little cleaning to keep things tidy.
Slack’s main limitation is disk space. Once everything is saved, it will quickly consume 5 GB of space in even a modest project. To help manage space, you can delete files that are taking up too much. That’s what this tutorial is about.
Members and guests can be configured to delete files or permission can be denied by the workspace administrator. Either way, you can delete inpidual Slack files without any plugins, but to delete all Slack files within a workspace, you’ll need a script.

Delete files from Slack
The exact way to delete files from Slack depends entirely on the platform you are using. It differs slightly between desktop, Android and iOS, so I’ll show you all of them. You can delete a file that you personally added to a workspace or from a shared channel. Anyone can delete files you add, but only workspace owners or administrators can delete files from shared channels. The method is the same for both.
On the desk:
- Select the channel name at the top right of the screen.

- Under the About section, scroll down and select the file you want to delete.

- Click the three dot menu icon and select Delete file.

- Confirm with Yes, delete this file.

On Android:
- Select the file you want to delete from Slack.

- Select the three dot menu icon at the bottom right of the screen and select Delete.

- Select Delete again to confirm.

On iOS:
- Select Your files within Slack.
- Select a file to delete.
- Select the three dot menu icon at the bottom right of the screen.
- Select Delete and then Yes, delete file to confirm.
You can only select to delete one file at a time, regardless of which platform you use. If you only have a couple of files, this should be fine. If you have more, you will need to use a plugin or script.

Delete all Slack files in bulk
To delete all Slack files in bulk, you will need to use a script. There are some good ones on GitHub that are free to use. They require Python to be installed on your computer in order to run them, but that’s easy to fix. The script I include below will delete all files that are older than 30 days. This helps save disk space while keeping the latest versions of files available to your computer.
- Download and install Python from here.
- Install the requests library in Python from here.
- Get yourself a Slack API Key.
- Create a file using Notepad or text editor and name it something meaningful. It must have the .py suffix to work in Python.
- Paste the following script into your .py file.
- Add your Slack API key where it says token=”. FOR EXAMPLE: token = ‘API KEY HERE’.
- Save the script and then run it.
The script text you need to paste:
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
params = {
'token': token
,'ts_to': ts_to
,'count': 1000
}
uri = 'https://slack.com/api/files.list'
response = requests.get(uri, params=params)
return json.loads(response.text)['files']
def delete_files(file_ids):
count = 0
num_files = len(file_ids)
for file_id in file_ids:
count = count + 1
params = {
'token': token
,'file': file_id
}
uri = 'https://slack.com/api/files.delete'
response = requests.get(uri, params=params)
print count, "of", num_files, "-", file_id, json.loads(response.text)['ok']
files = list_files()
file_ids = [f['id'] for f in files]
delete_files(file_ids)
This script is not my work but was taken from GitHub. All credit should go to the author of the code.
Managing disk space is one of the main challenges when using Slack, and deleting old files is a good way to overcome that limitation. If you manage a team or workspace, you now know how to delete all Slack files to manage disk space!