Truly Muting Email Conversations in Gmail

Gmail (and Mail in Google Apps for Business) offers the abil­i­ty to mute con­ver­sa­tions and hide them out of your way… But only if they’re cer­tain types of con­ver­sa­tions. The mute func­tion fails to work on arguably the most annoy­ing of con­ver­sa­tions. Here’s a way to fix it so that mute actu­al­ly mutes any thread.

Though unknown to many users, Gmail includes the abil­i­ty to mute a con­ver­sa­tion to save your san­i­ty and inbox from con­ver­sa­tions threads have out­lived their rel­e­vance to you. Where you’ve just received the first mes­sage about who wants lunch CC’d to your entire office or have giv­en up thir­ty mes­sages into a thread, you can mute the con­ver­sa­tion so that it (some­times) nev­er again appears in your inbox. The thread will still be saved in Gmail, avail­able if you need it, but out of the way, auto­mat­i­cal­ly archived by the Mute com­mand. Again, that func­tion has some caveats.

How to Mute Conversations

Muting one or more con­ver­sa­tions from your Inbox or any label/folder, fol­low these sim­ple three steps:

  1. Open or con­ver­sa­tion or, in list view, select one or more conversations.
  2. Click the More but­ton above your message(s).
  3. Choose Mute from the More menu (see Figure 1).
  4. Choosing Mute from the More menu to hide the conversation and all new message in its thread from the Inbox.
    Figure 1: Choosing Mute from the More menu to hide the con­ver­sa­tion and all new mes­sage in its thread from the Inbox.

[su_note note_color=“#deff96”]

TIP

If you have key­board short­cuts enabled in your Gmail account (and on your domain for your users in Google Apps for Business), press­ing the M key on your key­board will mute a con­ver­sa­tion with­out neces­si­tat­ing the use of the More menu.[/su_note]

Upon mut­ing, a con­ver­sa­tion will instant­ly dis­ap­pear from your Inbox, the­o­ret­i­cal­ly nev­er to return again. You can still find the con­ver­sa­tion archived accord­ing to any oth­er labels applied to it. To unmute a thread, select it and choose Unmute from the More menu.

[su_note note_color=“#deff96”]

TIP

You can find all mut­ed con­ver­sa­tions by search­ing Gmail for is:muted.
[/su_note]

Except It Doesn't Work

The prob­lem with Gmail’s mute func­tion, the rea­son many mut­ed con­ver­sa­tions keep com­ing back to the Inbox as if nev­er mut­ed in the first place, lies in this caveat from Gmail help: “Muted con­ver­sa­tions will only pop back into your inbox ready for your atten­tion if a new mes­sage in the con­ver­sa­tion is addressed to you and no one else, or if you’re added to the ‘To’ or ‘CC’ line in a new mes­sage.” In prac­tice, that caveat means that mute does­n’t work on one of the most com­mon clas­si­fi­ca­tions of email for which mute is desired–forum threads and mail­ing lists. Many forum and mail­ing list appli­ca­tions include your address in the TO or CC lines. Ergo, mute is defeat­ed for email from such sources. Because many peo­ple pri­mar­i­ly, or only, want to use mute for forum threads and mail­ing list mes­sages, Google’s excep­tion to mut­ing ren­ders the entire mute func­tion useless.

And that’s why I’ve cre­at­ed a solu­tion to fix mute’s self-defeating caveat.

Like apply­ing mute itself, the fix is a three-step process:

  1. Make a label in Gmail.
  2. Add a sim­ple Google script using the instruc­tions and script below. (Don’t be fright­ened by the word “script”; it’s just a copy and paste process, and I’ll talk you through it with­out you ever hav­ing to write a line of code.)
  3. Mute one or more con­ver­sa­tions as normal.

Step 1: Create a Label in Gmail

If you know how to cre­ate labels in Gmail, cre­ate one called “Muted” or what­ev­er else you like. You can even nest the label below par­ent labels.

If cre­at­ing Gmail labels is new to you, fol­low these steps after open­ing Gmail.

  1. In your Gmail Inbox, click the gear icon in the upper-right cor­ner and choose Settings from the menu as in Figure 2.
  2. Accessing Gmail's Setting menu via the gear icon.
    Figure 2: Accessing Gmail’s Setting menu via the gear icon.
  3. Click on Labels from the tabs list along the top of the main win­dow area.
  4. Your view may dif­fer from mine (see Figure 3), with more or few­er sec­tions. Find the Labels sec­tion and click the Create New Label button.
  5. Labels, which act like tags and folders in Gmail, can be created and edited from the Labels pane inside Gmail's Settings.
    Figure 3: Labels, which act like tags and fold­ers in Gmail, can be cre­at­ed and edit­ed from the Labels pane inside Gmail’s Settings.
  6. In the New Label dia­log enter the name for your new label (see Figure 4). That should be Muted. You can also choose to nest Muted beneath, or inside, anoth­er label that will act as a par­ent to Muted. Note that if you choose to nest the label beneath a par­ent, you will need to mod­i­fy a line of the copy-and-paste script below before it will work for you.
  7. Creating a new label to enable true muting of conversations.
    Figure 4: Creating a new label to enable true mut­ing of conversations.
  8. Click OK in the New Label dia­log to cre­ate the Muted label.
  9. Return to your Inbox by click­ing it in the left column.

With the Muted label cre­at­ed, you’re halfway to hav­ing a ful­ly func­tion­al conversation-muting func­tion in Gmail.

Step 2: Add a Simple Script to Google

If you’re already famil­iar with cre­at­ing Google scripts, feel free to jump down to the copy and paste por­tion. Otherwise, let’s start at the beginning.

  1. In anoth­er brows­er win­dow or tab, vis­it https://​dri​ve​.google​.com and log in if necessary.
  2. Click the New but­ton on the left and choose from the pop­up menu More > Google Apps Script. Up will pop a script edi­tor like the one in Figure 5.
  3. Creating a new Google Apps Script.
    Figure 5: Creating a new Google Apps Script.
  4. At the top, where it present­ly says “Untitled project,” click and rename the project to “Truly Mute Conversations”. Click OK to com­mit the new project name.
  5. In the code edi­tor beneath the Code​.gs tab, select all the exist­ing text and delete it.
  6. Copy the fol­low­ing code and paste it into the Google Apps Script code editor.
  7. function labelMutetoIgnore() {
      var batchSize = 100 // Process up to 100 threads at once
      var threads = GmailApp.search('is:muted');
      var label = GmailApp.getUserLabelByName("Muted");
      for (var t in threads) {
        threads[t].addLabel(label);
      }
    }
    
    function archiveMuted() {  
      var batchSize = 100 // Process up to 100 threads at once
      var threads = GmailApp.search('label:inbox label:Unimportant/Muted');
      for (j = 0; j  threads.length; j+=batchSize) {
        GmailApp.moveThreadsToArchive(threads.slice(j, j+batchSize));
      }
    }
    

    [su_note note_color=“#deff96”]

    NOTE

    If you nest­ed the Muted Gmail label beneath or inside anoth­er label, change the val­ue in line four to reflect the nest­ing. For exam­ple, if you put the Muted label under the par­ent label Unimportant, you would need to change line four to read var label = GmailApp.getUserLabelByName("Unimportant/Muted");.
    [/su_note]

  8. In the tool­bar above the code edi­tor click the disk-like Save but­ton to save the script. At this point you should have exact­ly what I have in Figure 6.
  9. After naming the script and pasting in the script code itself, the Truly Mute Conversations script is ready to be authorized and scheduled.
    Figure 6: After nam­ing the script and past­ing in the script code itself, the Truly Mute Conversations script is ready to be autho­rized and scheduled.
  10. Click the Run but­ton, which looks like a typ­i­cal play but­ton of an arrow fac­ing right, and is just a few but­tons away from Save.
  11. You’ll see a mes­sage appear at the top for a moment before you’re prompt­ed via a dia­log for autho­riza­tion to run the script. Click the Continue but­ton and then Allow in the sub­se­quent pop­up win­dow to allow Google to run the script in your Gmail account.
  12. [su_note note_color=“#deff96”]

    NOTE

    If you receive a “Script func­tion note found: myFunction” error, sim­ply save the script with the Save but­ton in the tool­bar again.
    [/su_note]

  13. We need to sched­ule the script to run on its own peri­od­i­cal­ly, so click the Current Project’s Triggers but­ton in the tool­bar. You’ll find it between Save and Run.
  14. When the Current Project’s Trigger dia­log appears to tell you that your script has­n’t any trig­gers, click the linked mes­sage to add one. That will reveal the fields in Figure 7.
  15. Creating the first project trigger.
    Figure 7: Creating the first project trigger.
  16. Leave the Run field set to the first func­tion, labelMutetoIgnore, but change the Events fields to, first, Time-Driven, then Minutes Timer, and, final­ly, Every 5 Minutes. You may want to change the inter­vals lat­er, check­ing every minute or every 10 min­utes, to suit your tastes.
  17. Click the Add a New Trigger link and repeat the trig­ger con­fig­u­ra­tion, using the same Time-Driven, Minutes-Timer, and Every 5 Minutes options but for the sec­ond func­tion, archiveMuted. You should end up with the same set­tings I have in Figure 8. Click Save.
  18. With both triggers configured to check Gmail every five minutes, muted conversations will now stay hidden even if Gmail would otherwise put them back into the Inbox.
    Figure 8: With both trig­gers con­fig­ured to check Gmail every five min­utes, mut­ed con­ver­sa­tions will now stay hid­den even if Gmail would oth­er­wise put them back into the Inbox.
  19. Save the script from the tool­bar and close the Truly Mute Conversations brows­er tab; unless you want to adjust the tim­ings or label nest­ing, you won’t need it again. The script is now com­plete and will auto­mat­i­cal­ly run, pro­cess­ing your email, every five min­utes until you close your Gmail account.
  20. [su_note note_color=“#deff96”]

    NOTE

    To edit the script in the future, sim­ply return to https://​dri​ve​.google​.com and double-click the Truly Mute Conversations script.
    [/su_note]

Step 3: Mute One or More Conversations

All the hard work is done–easy as it was. The final step is to test out the new Truly Mute Conversations script.

  1. In Gmail, either open a con­ver­sa­tion or select it by click­ing the check­mark field of the con­ver­sa­tion in list view. Make note of the sub­ject line of the con­ver­sa­tion; we’ll search for it again in a moment.
  2. Press M or choose Mute from the More menu. This will mute the con­ver­sa­tion, which, if you’re view­ing your Inbox, will imme­di­ate­ly archive the con­ver­sa­tion, mak­ing it disappear.
  3. Using the Search field at the top of Gmail, type in the sub­ject line of the email thread you just mut­ed and press Return/Enter. We need to find that mut­ed email.
  4. Once you’ve found the mut­ed con­ver­sa­tion, drag it over the Inbox entry at the top of the left col­umn and let go. This will move the mut­ed con­ver­sa­tion back to your Inbox, mim­ic­k­ing the behav­ior of Gmail when it receives a new mes­sage in the afore­men­tioned forum thread or oth­er type of con­ver­sa­tion where­in your address appears in the TO or CC field.
  5. Switch back to your Inbox, and wait. Within five min­utes the script we cre­at­ed should: 
    • Apply the Muted label to the con­ver­sa­tion in question.
    • Archive the con­ver­sa­tion again.

The pur­pose of the script is to over­come the glar­ing caveat in the mute func­tion. Utilizing my Truly Mute Conversations script fills in the hole, forc­ing Gmail to gen­uine­ly silence email con­ver­sa­tions you mark as mute–even if new mes­sages are received with your address in the TO or CC field.