Gmail Script to unsubscribe from mailing lists and newsletters

Martin Brinkmann
May 1, 2017
Updated • May 1, 2017
Email, Gmail
|
6

Gmail Unsubscribe is an open source script for Gmail to unsubscribe from mailing lists and newsletters semi-automatically.

If you are not careful about who you share your email address with, chance is high that it could land in spam databases eventually.

One of the main issues in this regard is that while you can be careful about it, people that you communicate with may not be that careful. All it takes is for them to subscribe to a service that parses the Gmail address book to push your email address to that service's database.

Anyway, the result is often that you are subscribed to mailing lists and newsletters that you have no interest in. If things go really wrong, newsletters and marketing emails may flood your inbox making it difficult to find the emails you are interested in.

Gmail Unsubscribe

Gmail Unsubscribe is an open source script that changes that. It was created by Amit Agarwal, the creator of Digital Inspiration, as a direct response to the Unroll.me incident. Unroll.me is a service that provides you with options to unsubscribe from mailing lists. Users grant the service access to their mailboxes for that, as it would not work otherwise, and accept the terms of service which state that data may be sold in anonymized form.

Gmail Unsubscribe is like that, but without involvement of a third-party. Once set up correctly, it enables you to send unsubscribe notices to select mailing list senders by tagging emails with the unsubscribe emails.  The activity is stored in a log that is kept on Google Sheets.

How it works? It checks for a list-unsubscribe field in the message header. This field, used by all legitimate services, contains an URL or an email address that you may use to unsubscribe.

The script parses the field, and if it finds an URL, opens it to unsubscribe you from the list.

Let me show you how to set this up:

First thing you need to do is copy the Gmail Unsubscriber sheet to your own Google Drive account. This sheet is a record log that keeps track of unsubscribe activities.

Once you have done that, click on the Gmail Unsubscriber menu entry on the Google Sheets site. You see it highlighted in read on the screenshot above.

You need to provide the script with permissions to access data of the Gmail account, and to change data on the Google Sheet spreadsheet. Please note that the script does not upload data to third-parties, it runs on the Google Account only, and only you have access to the data.

Once you have done all that, you may unsubscribe from any mailing list or newsletter that uses the header field by tagging it with the unsubscribe tag.

unsubscribe

The script checks for the link, runs the unsubscribe process if a link is found, and adds the information to the spreadsheet on Google Sheets (this may be delayed by a few minutes).

You can make multiple emails on Gmail, and add the tag to all of them to speed up the process even further.

What is interesting about the feature is that it works on Gmail, but also in official Gmail applications for mobile devices, and in third-party clients. As long as you can apply labels to emails, you are set and the script will function properly.

Manual option

list unsubscribe

If you run into spam mailing lists or newsletters only occasionally, you may use the manual method instead.

  1. Click on the email that you want to unsubscribe from.
  2. Click on the down arrow icon in the email preview pane (next to the sender name, date, and reply button), and select the show original menu item there.
  3. Locate the List-Unsubscribe field in the header. You may want to press on Ctrl-F to open the browser's on-page find functionality to locate it quickly.
  4. Either use the email address there to unsubscribe, or the link that is provided.

Now You: do you ignore (filter) spam mailing lists or newsletters, or unsubscribe from them?

Summary
Gmail Script to unsubscribe from mailing lists and newsletters
Article Name
Gmail Script to unsubscribe from mailing lists and newsletters
Description
Gmail Unsubscribe is an open source script for Gmail to unsubscribe from mailing lists and newsletters semi-automatically.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Rudi Pittman said on October 12, 2020 at 7:57 am
    Reply

    I don’t suppose an enhancement to auto delete any emails that come in where you have previously attempted to unsubscribe is in the works?

  2. krista said on May 2, 2017 at 8:46 am
    Reply

    Actually trying to unsubscribe will confirm that your email is active in the spammer database. After you click the unsubcribe link, your email data will be marked as ‘active’. I experienced this before, the spam mails were not gone but increased so now I just use the ‘mark as spam’ or ‘report mail’ function. By doing so the gmail system will move those spam mails to spam folder and eventually will be blocked from the gmail system because of sending too much spam mails I guess.

    1. Martin Brinkmann said on May 2, 2017 at 8:54 am
      Reply

      You are right, this may happen. I don’t think it will happen though if you unsubscribe from a newsletter or mailing list that is not operated by spammers.

  3. Clairvaux said on May 1, 2017 at 3:37 pm
    Reply

    I receive almost no spam. It’s really exceptional that I do. Practically all my mail is routed through a remailer, with a custom address created for each entity sending mail to me. If one of those abused my trust, and implemented the dreaded scenario of “they sell your adress to spammers” (or got their mail database hacked), it would be enough for me to click a switch next to that address, and deactivate it. (Not even killing it ; I could keep it for future use, hoping the spammers got discouraged ; or, I could go further and delete it completely.)

    Well, the number of times I has to resort to that over the years is ridiculously small. The remailing service certainly gives me peace of mind, and I’m not about to abandon it. But I almost never use its most touted capacity : that to deactivate an address — except to prune addresses that I no longer use, or used just once, or even have never received any mail through.

    Before getting to that (mostly unneeded) stage, I can, and do, unsubscribe to various newsletters or marketing mails I have consented to receive, or actively subscribed to. Again, this mostly works. The vast majority of senders abide by my wishes.

    So when they tell you : don’t unsubscribe from spam, it will only add you to the valid list, it all depends on your definition of spam. If, by that, you mean Viagra sellers, yes, I suppose you shouldn’t unsubscribe from them. (Although I couldn’t tell you : I never receive such mail, for some reason.) If you mean : annoying mail pushing products or information you’re not interested in any longer, then it’s wrong. Unsubscribing from mail you’re receiving because you did something (actively asked for it, or bought something from the sender, or subscribed to his services) is mostly efficient and safe.

    In very, very rare cases, I have ran into dishonest or smart-alec senders, who don’t unsubscribe when asked through their own unsubscribing service, or who unsubscribe you from the news service you’re receiving, only to serve you another — and they have a bunch of those. This is annoying because you have to keep tabs : have I not already unsubscribed from that newsletter ? Only when you’re sure they are making a fool of you, can you flick the switch at remailer level. Or write a rule at mail client level, to automatically dump such annoyances in an Unwanted folder. Which I had to do maybe twice, in long, long years of using Microsoft Outlook.

    Another rare case where the kill switch might be needed is those instances (and they still exist) where people ask you to surrender your email address in handwriting, in order to serve you some sort of newsletter. Those people, or entities, usually have no automated unsubscribing mechanism in place. Often, the only mean to unsubscribe from them is to write them an email — and hope that they care enough to unsubscribe you manually, provided there is even someone reading emails at all on their end.

    So my experience is you don’t need this sort of scrubbing corrective when you practice correct email hygiene upstream. Are there really services which ask, and get, permission to parse Gmail address books, then use those adresses in a rogue way ? That’s outrageous.

    1. krista said on May 2, 2017 at 8:58 am
      Reply

      I did not read your comment until I wrote mine..

      >So when they tell you : don’t unsubscribe from spam, it will only add you to the valid list, it all depends on your definition of spam.

      >In very, very rare cases, I have ran into dishonest or smart-alec senders, who don’t unsubscribe when asked through their own unsubscribing service, or who unsubscribe you from the news service you’re receiving, only to serve you another — and they have a bunch of those.

      Agreed! I’ve experienced them as well.

      >Another rare case where the kill switch might be needed is those instances (and they still exist) where people ask you to surrender your email address in handwriting, in order to serve you some sort of newsletter. Those people, or entities, usually have no automated unsubscribing mechanism in place. Often, the only mean to unsubscribe from them is to write them an email — and hope that they care enough to unsubscribe you manually, provided there is even someone reading emails at all on their end.

      I once asked information about travel in a quite big travel agency(H.I.*). Some weeks later I received email spam about their travel packages and events. There’s no unsubscribe link and no way to unsubscribe. So I wrote to them to remove my mail from their subscription but I received no reply. I just mark their mail as spam and blocked them. I swear to not use their service again in the future.

      Even emails that I use for friends are also get spammed. I think those spammer use the ‘share to your friends’ thing to get my email from my contacts. So the only thing I can rely now is gmail’s power to block those spams. I don’t use thing like routing mail, too much hassle and those are not free right?

      Fun fact: Few days after I created a new Yahoo account, those account already got some spam emails. I hadn’t use it at all by that time but how come spams already came to the inbox? Did Yahoo sell mail data as well?

      1. Clairvaux said on May 2, 2017 at 2:30 pm
        Reply

        I once created a new address on my ISP mail server, and got a piece of spam soon afterwards, before I had used it anywhere. This really made me paranoid. It did not happen since, and I still haven’t understood how it happened.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.