Cleanup your personal Gmail using a Google App Scripts.
This AppScript will leave you with no more than 100 Social, Updates, Promotions, and Forums emails.
If you have a lot of email subscriptions and other updates and you are not periodically unsubscribing, manually deleting, or filtering then you probably have good amount of junk email.
You may even have to pay to add storage.
Sign up for Google App Scripts workspace.
Click on New Project once you are signed in.
Enable Gmail services for the AppScript.
Copy in appscript.json
to set the OAuth scope.
The Apps Script editor hides manifest files by default in order to protect your Apps Script project settings. Follow these steps to make a hidden project manifest visible in the Apps Script editor:
- Open the script project in the Apps Script editor.
- Click Project Settings settings.
- Select the ```Show appsscript.json`` manifest file in editor checkbox.
You will be prompted to access to your personal account so that the script can run using your gmail credentials.
Edit the script properties and add the ```currentCategory`` property setting a starting point.
Now that the project settings are in place add the script. Enter into editor mode and copy in ```CleanupGmail.gs``.
Add a new Trigger and select ```batchDeleteEmail`` to run on an hourly timer.
Important: The Max batchSize is 100. Anything larger will cause the script to fail within a 24hour window.
var batchSize = 100
Watch it run and periodically check it. Navigate over to executions to see the execution log.
If all categories are below the 100 email threshold then stop processing.
The maximum batchSize is 100. var batchSize = 100
The main constraint is the number of times you can call batchDeleteEmail
in a 24 hour period.
Google throttles at around ~10K daily.