Batch delete thousands of Gmail drafts in seconds
Mail in macOS has long suffered from a bug that can generate thousands of near-duplicate Gmail drafts (the simplest workaround is switching draft storage from server to local).
Selecting more than 50 drafts in the Gmail web interface via "Select all x messages in Drafts" disables the "Discard drafts" option, making large-scale deletion tedious.
A faster alternative is using Google Apps Script. While script executions are limited to 6 minutes, the following API-based method can delete thousands of drafts in seconds:
Go to https://script.google.com → New project
Paste and save the following script:
In the left-hand menu, click + next to Services
Select Gmail API → Add
Click Run
During testing, used this script to quickly generate 105 drafts:
Addendum: Delete emails by date and (optionally) label
❧ 2025-08-06