Efficient way to delete large number of files from root dir in Google drive
23:46 26 Mar 2025

I'm trying to delete over 500,000 image files stored in the root directory of my Google Drive, but I’m facing several challenges and have tried a few approaches without success.

Manual deletion: attempted to manually delete the files through the Google Drive interface, but the sheer volume (500k+ images) makes this approach unfeasible and very slow.

Mounting Google drive and writing a script: I've tried mounting Google Drive to a local environment and running a Python script to delete the files, but the mounting failed due to permission issues or connectivity problems.

Google Apps script: I've used Google Apps Script to try deleting the files programmatically. However, Apps Script hits the daily quota limits or takes too long to execute due to the large number of files.

Does anyone have an efficient solution to batch delete a large number of files from the root directory of Google Drive? I would appreciate any insights or alternative methods that can speed up this process.

google-drive-api