Skip to content

Instantly share code, notes, and snippets.

View dwightmulcahy's full-sized avatar

dWiGhT dwightmulcahy

  • San Antonio, TX
  • 13:22 (UTC -06:00)
View GitHub Profile
@dwightmulcahy
dwightmulcahy / emptygmailtrash.js
Last active November 22, 2025 21:55
Google app script to empty the trash. A time out of 5 minutes is built in to avoid the "Function execution has timed out" error if it runs too long.
// ----------------------------
// --- GLOBAL CONFIGURATION ---
// ----------------------------
// Define the list of Gmail folders (labels) to be cleaned.
// To specify a custom label that is nested under another, use a forward slash '/'.
const FOLDERS_TO_CLEAN = ["Trash", "Spam", "My Custom Label"]; // <--- CONFIGURE YOUR FOLDERS HERE
// Define a list of email addresses from which to delete messages.
// If this list is empty, the script will delete messages from ALL senders
// found within the FOLDERS_TO_CLEAN.