Web

How To Mark All Gmail Archived Mails As Read

Though Outlook has been coming up with a lot of innovations, Gmail has always been giving the service a run for its money. Gmail is full of gimmicks and genuinely useful features, which make it the best fit for any tech user’s daily needs. Back in the day it was a big deal when Gmail started reminding users that they are sending an email without an attachment even though the word ‘attach’ is mentioned in the body. We have come a long way since then. These days, you can set ‘Reply All’ as your default respond option, and Gmail archived mails are a good way of keeping your inbox clutter-free. If you are well-organized though, it might bother you not marking Gmail archived mails as read automatically when you move them. To resolve this problem, a simple script can help.

There are several scripts and even apps that can help you augment the functionality offered by Gmail. We covered an app to increase the Gmail attachment size limit on Android a short while ago. The current method isn’t as simple to use, but you only have to create and run the script once. After that, all Gmail archived mails will be automatically marked as read as soon as you move them out of your inbox.

Gmail Archived Mails

Automatically Marking Gmail Archived Mails As Read

  1. On your web browser, sign in to your Gmail account. Make sure you are not in incognito mode.
  2. Open a new tab without signing out of Gmail, and visit the following link;
    script.google.com
  3. Hit the ‘Start Scripting button’.
  4. Choose the ‘Blank Project’ option from the resulting screen.
  5. Select all of the existing lines of code written in the text area.
  6. Copy the following lines of code and replace the entire text selected in the previous step;
    function markArchivedAsRead() {
      var threads = GmailApp.search('label:unread -label:inbox');
      GmailApp.markThreadsRead(threads);
    };
  7. Under the ‘File’ tab, hit ‘Save’.
  8. Switch back to the Gmail window opened in step 1 while keeping the Scripting screen open.
  9. Hit the ‘All Mail’ option and look for a Gmail archived email. It should be a message that doesn’t have any tag next to it. Choose one archived mail and mark it as unread. If all emails are unread, leave them as they are.
  10. Switch back to the script and hit the play icon to run it. This should mark all Gmail archived mails as read.
  11. Go to the ‘Resources’ tab in the scripting screen.
  12. Under the ‘Current Project’s triggers’ option, you can choose the duration after which the script is run and all your archived messaged are marked as read.

Gmail Archived Script Trigger

The above method is very simple to follow, and should work for you both on Android and web. Do give it a shot if you want a much cleaner Gmail inbox.