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:

  1. Go to https://script.google.comNew project

  2. Paste and save the following script:

  3. In the left-hand menu, click + next to Services

  4. Select Gmail APIAdd

  5. Click Run

During testing, used this script to quickly generate 105 drafts:

Addendum: Delete emails by date and (optionally) label

❧ 2025-08-06