Gmail Bulk Delete by Label
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
This userscript helps you clean up your Gmail inbox by identifying and bulk-selecting labels to delete all emails under them. It scans Gmail inbox or email list pages for Gmail labels—categories like "Social", "Promotions", "Updates", "Forums", or custom labels—and allows you to select multiple labels to bulk delete all emails under those labels. It shows the number of emails in each label, filters by label type, and maintains a list of already deleted labels to avoid duplicates. It exports the list of selected labels and provides a confirmation step before taking action. The script simulates the delete action by moving emails to Trash or marking them for deletion.
WHERE IT RUNS
The script works on Gmail inbox pages, email list pages, and any webpage with Gmail label information. It runs entirely within your browser, reading only the visible content of the current page. It does not track your browsing history, access other tabs, or send any data externally. All label data and delete history are stored locally.
HOW TO USE
After installation, open the panel by clicking the tool's icon in the BotGentz sidebar. Click "Scan for labels" to extract labels from the current page. The panel displays a list of unique labels with checkboxes, showing the number of emails per label and whether it's a system or custom label. Select the labels you want to delete—use "Select All" to choose all. Click "Delete Selected (Track)" to mark them as deleted and add them to your history. Click "Search in Gmail" to open a Gmail search for all emails with the selected labels, so you can manually delete them. Click "Export Selected" to download a text file with the selected label names. Use "Clear History" to reset the delete history.
THE TECHNICAL MECHANISM
This script uses DOM traversal and text pattern matching to extract label information from Gmail pages. It scans for common label names (Social, Promotions, Updates, Forums, Spam, Trash, Drafts, Sent, Inbox) and looks for label elements with class names like "label", "category", or "J-Kg". It counts email occurrences using patterns like "Label (12)" and estimates counts from text occurrences. The script stores the delete history in GM_setValue so you don't see already-deleted labels in future scans. The search function builds a Gmail search query with "label:name1 OR label:name2" and opens it in a new tab. The export function creates a plain text file with the selected label names. All operations are client-side and do not send any data externally.
THE PANEL
The panel is draggable anywhere on the screen and remembers its position between sessions. It can be collapsed to a small floating bubble to minimize distraction, and expanded again with a single click. The panel's width can be adjusted, and pressing the Escape key closes it instantly. All settings—delete history and auto-scan preference—are persisted locally using GM_setValue, so your data remains intact across page reloads and browser restarts.
PLEASE NOTE
This userscript requires the free BotGentz extension to function. The script extracts labels from page text and helps you track which labels you've deleted. It does not automatically delete emails—you'll need to use the "Search in Gmail" feature to find and manually delete them. The script is a helper tool to identify and track labels you want to delete. The extraction relies on the current text patterns on the page—if Gmail updates its UI, the script may need to be updated. The script does not access your Gmail account or API; it only reads what is visible on the page. No data from your browsing is stored or transmitted anywhere—all processing occurs entirely in your browser.