How to automatically archive Gmail with filters
To automatically archive Gmail, create a filter whose action is Skip the Inbox (Archive it); matching mail then goes straight to All Mail with any label you add. Filters act on arrival only, so archiving mail after 30 days takes a search, not a rule. An archive in Gmail is not a backup copy; the last section covers the automatic version of that too.
Automatically archive Gmail with a filter on arrival
- In Gmail on a computer, click the filter icon at the right end of the search box (Show search options).
- Fill in the criteria: a sender in From, words in Subject or Has the words, or Has attachment. Click Search first to see what will match.
- Open the options again and click Create filter.
- Tick Skip the Inbox (Archive it). Optionally tick Apply the label and choose or create one, and Mark as read if you do not want an unread count.
- Tick Also apply filter to matching conversations to archive the existing matches in one go, then click Create filter.
From then on, every new matching message bypasses the inbox and sits under All Mail and the label. Nothing is deleted; the mail is still searchable and still counts toward storage. The manual side of this, including where archived mail goes, is in archive emails in Gmail.
Have the email as a file (EML, MSG, MBOX)? Convert it to PDF in your browser: nothing is uploaded.
Auto label and archive by sender, subject or list
The criteria box accepts the same operators as search, which makes the rules precise. Some that people use:
from:(newsletter@example.com OR digest@example.org)to archive several senders with one filter.list:announce.example.comfor a mailing list, which keeps matching even when the sender address changes.subject:(receipt OR invoice) has:attachmentto file paperwork under a label such asReceiptswithout seeing it.to:me+promo@gmail.comfor sign-ups made with a plus address; everything sent to that alias archives itself.category:promotionsorcategory:socialto keep category mail out of the inbox entirely.
Filters are listed under Settings, Filters and Blocked Addresses, where you can edit, delete, export them as a file or import a set made elsewhere. Order does not matter; all matching filters apply.
Archive old emails after 30 days or by date
Gmail has no rule that says "archive anything in the inbox older than 30 days." Filters run once, when a message arrives, and never look at the inbox again. Three options exist, from built-in to scripted:
- A saved search you run by hand. Search
in:inbox older_than:30d, tick select all, click Select all conversations that match this search, click Archive. Bookmark the search URL and it is a two-click routine. Variants:older_than:1y,before:2026/01/01,is:read older_than:7d. - Google Apps Script. A short script in script.google.com can run the same search daily and archive the results with the Gmail service, on a time-driven trigger. It is a Google feature, free, and stays inside your account; it needs a few lines of code and a one-time permission grant.
- Add-ons. Marketplace add-ons offer auto-archive by age; they need access to the mailbox, so read what they request.
Snooze is a different tool: it hides a message until a date and then brings it back, which is the opposite of archiving.
Turn off auto archive
Mail that vanishes from the inbox on its own almost always has a filter behind it. Open Settings, Filters and Blocked Addresses, and look for filters with Skip Inbox in their description; edit or delete them. The other usual causes:
- Inbox categories (Promotions, Social, Updates) move mail to tabs, not to the archive; configure them under Settings, Inbox.
- Swipe actions in the Gmail app archive with a flick; change them under the app's General settings.
- Send and Archive, a button that archives the conversation when you reply; switch it off under Settings, General.
- A forwarding or POP setup on another account may be configured to archive the fetched messages.
Gmail itself never archives mail on a timer; if it is gone from the inbox and not in Trash, it is in All Mail.
Which rule for which job
| Goal | Use | Applies to |
|---|---|---|
| Newsletters out of the inbox, kept | Filter: Skip the Inbox, Apply the label | New mail, plus existing if ticked |
| Receipts filed without reading | Filter with has:attachment and a label | New mail |
| Inbox cleared of anything over 30 days | Search older_than:30d, select all, Archive | Existing mail, when you run it |
| Same, every night | Apps Script with a time trigger | Existing mail, scheduled |
| A copy outside Gmail, on a schedule | Takeout recurring export or a forwarding filter | See below |
Auto backup Gmail: an archive you actually own
Everything above rearranges mail inside the account. If the account is lost, the archive is lost with it. Two built-in options make copies automatically. Google Takeout can run Export every 2 months for 1 year, delivering an MBOX of the selected labels to a download link or straight to Drive, Dropbox, OneDrive or Box. A filter with Forward it to sends every new message, or every message matching a rule, to a second address at another provider.
To check a Takeout copy or pull a record out of it, drop the .mbox on SaveMail. The messages are listed in your browser, each one renders with its headers, body and attachments, and any of them saves as PDF through the print dialog; nothing is uploaded and the page works offline. It is one message at a time, which suits spot checks and the occasional record rather than converting a whole backup. The full backup routine is in backup Gmail emails, and the reasoning about what to keep for how long is in the email archiving guide.
Frequently asked questions
Does Gmail automatically archive emails?
Not on its own. Mail leaves the inbox only through a filter with Skip the Inbox, the Archive button, a swipe, or Send and Archive. Archived mail is in All Mail.
How do I auto archive Gmail after 30 days?
There is no built-in age rule. Search in:inbox older_than:30d, select all matching conversations and click Archive, or schedule the same search with Google Apps Script.
How do I auto label and archive in Gmail?
Create a filter with your criteria and tick both Skip the Inbox (Archive it) and Apply the label. Tick Also apply filter to matching conversations for existing mail.
How do I turn off auto archive in Gmail?
Delete or edit the filters marked Skip Inbox under Settings, Filters and Blocked Addresses, and check swipe actions and Send and Archive if the problem continues.
Is Gmail auto archive the same as auto backup?
No. Archiving keeps mail inside the account. A backup is a copy elsewhere: a recurring Takeout export or a forwarding filter to another address.
Can a Gmail filter archive by date?
Filters match on arrival, not later, so they cannot archive by age. Use the older_than search operator with select all, or a scheduled script.