Skip to content

Email & Inbox

Unsubscribe Sweeper

Auto-files marketing mail and unsubscribes you from anything you haven't opened in 30 days.

Saves about ~1 hr per week

What it does

  • Detects newsletters and promotional mail as it arrives
  • Tracks which ones you actually open and click
  • Automatically unsubscribes from senders you ignore for 30 days
  • Files everything else into your Newsletters folder for later

How it works

  1. Mail lands and is classified as promotional
  2. Sender activity is logged in an attached sheet
  3. Senders ignored for 30 days get an auto-unsubscribe
  4. Remaining promos go straight to the Newsletters folder

What's included

  • Tracking sheet template
  • Auto-unsubscribe rules
  • Weekly sweep schedule

Set it up yourself

Follow these 4 steps in order. You will need accounts for: Gmail.

Step 1: Create the tracking sheet

  1. Go to https://sheets.new and create a spreadsheet named "Unsubscribe Tracker".
  2. In cells A1:D1 add headers: Sender, Last Opened, Last Clicked, Status.
  3. Add a second sheet/tab named "Rules" with headers: Sender, Action (archive-only or auto-unsubscribe).
  4. Copy the spreadsheet URL — you will paste its ID into the script.

Watch out: The script keys off the Status column, so do not rename it and do not merge cells.

Step 2: Wire the Gmail label

  1. In Gmail Settings → Filters and Blocked Addresses → "Create a new filter".
  2. Tick "It has the word" and enter: category:promotions OR category:updates (this catches most marketing mail).
  3. Tick "Skip the Inbox (Archive it)" and "Apply the label" → choose or create the label "Newsletters".
  4. Click "Create filter".
  5. Confirm historical mail: on the filter, check "Also apply filter to X matching conversations" to file your existing backlog.

Watch out: This filter archives mail instantly. If you want a grace period first, leave "Skip the Inbox" unticked until the script is running.

Step 3: Add the inactivity rule

  1. Open https://script.google.com, create a project named unsubscribe-sweeper, and paste the guide's script.
  2. In Project Settings → Script Properties, add SPREADSHEET_ID (your sheet's ID) and LABEL_NAME (Newsletters).
  3. Find the DAYS_INACTIVE constant and set it to 30.
  4. The script checks each sender's last-opened date in the sheet; when it passes 30 days it marks Status = unsubscribe-pending.
  5. For pending senders, the script calls the provider's unsubscribe link if one is stored in Rules, or marks them safely archive-only.

Watch out: The script never auto-sends an unsubscribe email for you — it only clicks safe one-click list-unsubscribe links and reports the rest.

Step 4: Schedule the sweep

  1. In the Apps Script editor, open the Triggers page (clock icon).
  2. Add a trigger to run function `sweepNewsletters` weekly (e.g. Mondays 9-10am).
  3. Add a second trigger for `logSenders` every day, so the sheet stays fresh.
  4. Run once manually and open the sheet — confirm senders are being logged.
  5. Each Monday, review the Status column to see what was unsubscribed vs archived.

Watch out: Quota: Gmail Apps Script has a daily quota of roughly 1,500 messages read. The weekly sweep plus daily logging stays well under it for a personal inbox.

Frequently asked questions

What does the Unsubscribe Sweeper automation do?

Auto-files marketing mail and unsubscribes you from anything you haven't opened in 30 days. Detects newsletters and promotional mail as it arrives

How much time does Unsubscribe Sweeper save?

It is estimated to save ~1 hr per week. Actual savings depend on your volume.

Which tools does Unsubscribe Sweeper use?

It works with Gmail.

What does Unsubscribe Sweeper include?

Tracking sheet template, Auto-unsubscribe rules, Weekly sweep schedule.

Can I set up Unsubscribe Sweeper myself?

Yes. The do-it-yourself guide on this page walks through 4 steps, from getting access to testing the finished automation.