Ever had a messy inbox full of mails? Does it bother you to skip the inbox? Luckily, Google has provided many services that we can harness its utilities to organize the mail using personal preferences or workflow.
You will able to make an auto email archiver/remover after following the steps. This will be done by using Google Apps Script and setting the schedule trigger. The code is pretty simple and straightforward since Google has already provided us with ready-to-use objects for managing Gmail.
Source: Manage Gmail with Google Script