Blog / Productivity

Truly Muting Email Conversations in Gmail

Truly Muting (Hiding) Email Conversations in Gmail

Gmail (and Mail in Google Apps for Business) offers the ability to mute conversations and hide them out of your way… But only if they’re certain types of conversations. The mute function fails to work on arguably the most annoying of conversations. Here’s a way to fix it so that mute actually mutes any thread.

Though unknown to many users, Gmail includes the ability to mute a conversation to save your sanity and inbox from conversations threads have outlived their relevance to you. Where you’ve just received the first message about who wants lunch CC’d to your entire office or have given up thirty messages into a thread, you can mute the conversation so that it (sometimes) never again appears in your inbox. The thread will still be saved in Gmail, available if you need it, but out of the way, automatically archived by the Mute command. Again, that function has some caveats.

How to Mute Conversations

Muting one or more conversations from your Inbox or any label/folder, follow these simple three steps:

  1. Open or conversation or, in list view, select one or more conversations.
  2. Click the More button 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 conversation and all new message in its thread from the Inbox.

TIP

If you have keyboard shortcuts enabled in your Gmail account (and on your domain for your users in Google Apps for Business), pressing the M key on your keyboard will mute a conversation without necessitating the use of the More menu.

Upon muting, a conversation will instantly disappear from your Inbox, theoretically never to return again. You can still find the conversation archived according to any other labels applied to it. To unmute a thread, select it and choose Unmute from the More menu.

TIP

You can find all muted conversations by searching Gmail for is:muted.

Except It Doesn’t Work

The problem with Gmail’s mute function, the reason many muted conversations keep coming back to the Inbox as if never muted in the first place, lies in this caveat from Gmail help: “Muted conversations will only pop back into your inbox ready for your attention if a new message in the conversation is addressed to you and no one else, or if you’re added to the ‘To’ or ‘CC’ line in a new message.” In practice, that caveat means that mute doesn’t work on one of the most common classifications of email for which mute is desired–forum threads and mailing lists. Many forum and mailing list applications include your address in the TO or CC lines. Ergo, mute is defeated for email from such sources. Because many people primarily, or only, want to use mute for forum threads and mailing list messages, Google’s exception to muting renders the entire mute function useless.

And that’s why I’ve created a solution to fix mute’s self-defeating caveat.

Like applying mute itself, the fix is a three-step process:

  1. Make a label in Gmail.
  2. Add a simple Google script using the instructions and script below. (Don’t be frightened by the word “script”; it’s just a copy and paste process, and I’ll talk you through it without you ever having to write a line of code.)
  3. Mute one or more conversations as normal.

Step 1: Create a Label in Gmail

If you know how to create labels in Gmail, create one called “Muted” or whatever else you like. You can even nest the label below parent labels.

If creating Gmail labels is new to you, follow these steps after opening Gmail.

  1. In your Gmail Inbox, click the gear icon in the upper-right corner 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 window area.
  4. Your view may differ from mine (see Figure 3), with more or fewer sections. Find the Labels section 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 folders in Gmail, can be created and edited from the Labels pane inside Gmail’s Settings.

  6. In the New Label dialog enter the name for your new label (see Figure 4). That should be Muted. You can also choose to nest Muted beneath, or inside, another label that will act as a parent to Muted. Note that if you choose to nest the label beneath a parent, you will need to modify 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 muting of conversations.

  8. Click OK in the New Label dialog to create the Muted label.
  9. Return to your Inbox by clicking it in the left column.

With the Muted label created, you’re halfway to having a fully functional conversation-muting function in Gmail.

Step 2: Add a Simple Script to Google

If you’re already familiar with creating Google scripts, feel free to jump down to the copy and paste portion. Otherwise, let’s start at the beginning.

  1. In another browser window or tab, visit https://drive.google.com and log in if necessary.
  2. Click the New button on the left and choose from the popup menu More > Google Apps Script. Up will pop a script editor 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 presently says “Untitled project,” click and rename the project to “Truly Mute Conversations”. Click OK to commit the new project name.
  5. In the code editor beneath the Code.gs tab, select all the existing text and delete it.
  6. Copy the following 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));
      }
    }
    

    NOTE

    If you nested the Muted Gmail label beneath or inside another label, change the value in line four to reflect the nesting. For example, if you put the Muted label under the parent label Unimportant, you would need to change line four to read var label = GmailApp.getUserLabelByName("Unimportant/Muted");.

  8. In the toolbar above the code editor click the disk-like Save button to save the script. At this point you should have exactly 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 naming the script and pasting in the script code itself, the Truly Mute Conversations script is ready to be authorized and scheduled.

  10. Click the Run button, which looks like a typical play button of an arrow facing right, and is just a few buttons away from Save.
  11. You'll see a message appear at the top for a moment before you're prompted via a dialog for authorization to run the script. Click the Continue button and then Allow in the subsequent popup window to allow Google to run the script in your Gmail account.
  12. NOTE

    If you receive a "Script function note found: myFunction" error, simply save the script with the Save button in the toolbar again.

  13. We need to schedule the script to run on its own periodically, so click the Current Project's Triggers button in the toolbar. You'll find it between Save and Run.
  14. When the Current Project's Trigger dialog appears to tell you that your script hasn't any triggers, click the linked message 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 function, labelMutetoIgnore, but change the Events fields to, first, Time-Driven, then Minutes Timer, and, finally, Every 5 Minutes. You may want to change the intervals later, checking every minute or every 10 minutes, to suit your tastes.
  17. Click the Add a New Trigger link and repeat the trigger configuration, using the same Time-Driven, Minutes-Timer, and Every 5 Minutes options but for the second function, archiveMuted. You should end up with the same settings 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 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.

  19. Save the script from the toolbar and close the Truly Mute Conversations browser tab; unless you want to adjust the timings or label nesting, you won't need it again. The script is now complete and will automatically run, processing your email, every five minutes until you close your Gmail account.
  20. NOTE

    To edit the script in the future, simply return to https://drive.google.com and double-click the Truly Mute Conversations script.

Step 3: Mute One or More Conversations

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

  1. In Gmail, either open a conversation or select it by clicking the checkmark field of the conversation in list view. Make note of the subject line of the conversation; we'll search for it again in a moment.
  2. Press M or choose Mute from the More menu. This will mute the conversation, which, if you're viewing your Inbox, will immediately archive the conversation, making it disappear.
  3. Using the Search field at the top of Gmail, type in the subject line of the email thread you just muted and press Return/Enter. We need to find that muted email.
  4. Once you've found the muted conversation, drag it over the Inbox entry at the top of the left column and let go. This will move the muted conversation back to your Inbox, mimicking the behavior of Gmail when it receives a new message in the aforementioned forum thread or other type of conversation wherein your address appears in the TO or CC field.
  5. Switch back to your Inbox, and wait. Within five minutes the script we created should:
    • Apply the Muted label to the conversation in question.
    • Archive the conversation again.

The purpose of the script is to overcome the glaring caveat in the mute function. Utilizing my Truly Mute Conversations script fills in the hole, forcing Gmail to genuinely silence email conversations you mark as muteeven if new messages are received with your address in the TO or CC field.

You may also like...

Leave a Reply

%d bloggers like this: