Gmail – How to Mark All Mail as Read at End of Day

automationgmailgmail-filters

Is there a way to automatically mark all the emails in my Gmail inbox as read at the end of every day?

Even better, if it didn't mark the email in the 'Primary' tab read.

Note: I am looking for an automatic way to do this at the end of the day.

Best Answer

From here, I got a script and modified it:

  1. Go to script.google.com, and select 'Gmail' from the left hand side of the popup.
  2. Delete all existing code, and paste this (the modified version):
function markAllAsRead() {   
  var threads = GmailApp.search('in:unread');   
  GmailApp.markThreadsRead(threads); 
};
  1. Save the file, and run it, making sure to allow access when it asks you.
  2. Go to Resources > Current Project's Triggers and add a trigger to do it, for example every week.