Free tool, no signup
Gmail filter generator
This free Gmail filter generator turns a few plain choices into filters Gmail can import. Set who an email comes from, what it says and what Gmail should do with it. You get a search string to test each filter and one mailFilters.xml file that imports them all, built in your browser so nothing you type is sent anywhere.
Gmail filter generator
Add a starter filter
Click or tap a filter's name to rename it. Gmail doesn't show filter names, so the file keeps each one as a note above its filter.
Your filters1newest first
Receipts
ReadyTest Receipts in Gmail search
subject:(receipt OR invoice OR "order confirmation")
1 of 1 filter is ready: Receipts. Download the file, then in Gmail open Settings, See all settings, Filters and Blocked Addresses, and click Import filters.
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:apps="http://schemas.google.com/apps/2006">
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:</id>
<updated>2026-10-11T00:00:00Z</updated>
<author>
<name>Construct Gmail filter generator</name>
<email>[email protected]</email>
</author>
<!-- Receipts -->
<entry>
<category term="filter"></category>
<title>Mail Filter</title>
<content></content>
<apps:property name="subject" value="(receipt OR invoice OR "order confirmation")"></apps:property>
<apps:property name="label" value="Receipts"></apps:property>
<apps:property name="shouldArchive" value="true"></apps:property>
</entry>
</feed>
Filters match words, so a client asking for a quote and a cold pitch that use the same words end up in the same place. Construct reads each new email, sorts it into labels like Reply needed and FYI, and drafts the replies for you to check and send, from $9 a month.
Let Construct sort your inboxGmail filter syntax cheat sheet
The generator writes these operators for you. They also work typed straight into Gmail's search bar or the Has the words box.
| Operator | What it matches | Example |
|---|---|---|
| from: | The sender, a full address or a domain | from:@acme.com |
| to: | A recipient | to:[email protected] |
| subject: | Words in the subject line | subject:invoice |
| OR | Either term, written in capitals | from:([email protected] OR [email protected]) |
| - | Leaves out emails with the word | newsletter -unsubscribe |
| " " | An exact phrase | "order confirmation" |
| ( ) | Groups terms together | subject:(receipt OR invoice) |
| has:attachment | Emails with any attachment | has:attachment from:@bank.com |
| filename: | An attachment name or type | filename:pdf |
| larger: / smaller: | Email size in bytes, K or M | larger:10M |
| list: | Mailing list emails | list:[email protected] |
Frequently asked questions
How do I import a filters XML file into Gmail?
Open Gmail on a computer, click the gear icon and choose See all settings. On the Filters and Blocked Addresses tab, click Import filters at the bottom, choose the mailFilters.xml file and click Open file. Tick the filters you want, then click Create filters.
How do I filter emails from multiple senders or a whole domain?
Type the addresses in From, separated by commas, and the generator joins them with OR, which is the form Gmail needs: from:([email protected] OR [email protected]). For everyone at a company, enter the domain on its own, like @acme.com. Gmail has no wildcard such as *, and the domain does the same job.
Will a new filter sort the emails I already have?
Not on its own, because filters act on mail as it arrives. To sort older mail, open Settings, Filters and Blocked Addresses, click edit next to the filter, click Continue, tick Also apply filter to matching conversations and click Update filter.
Can I create Gmail filters on an iPhone or Android phone?
Not in the Gmail app, which can't create, edit or import filters. You can build the file on your phone with this page, then import it from Gmail in a browser on a computer.
Can a Gmail filter delete emails after 30 days?
No. A filter runs once, when an email arrives, so a rule like older_than:30d never matches new mail. To clear old mail, search for older_than:30d with your other conditions, select all the results and delete them, and repeat when you need to.
Should I create my labels before importing?
Yes, that's the safe order. Create any new label in Gmail first, under Settings, Labels, Create new label, and type the name here exactly the same way, capitals included. For a nested label, use a slash, like Clients/Acme.
Can a filter tell an urgent email from one that can wait?
Not really. A filter only checks the sender, the subject, words in the email and a few properties like size and attachments. It can't tell a client asking for a quote from a sales pitch that uses the same words. That kind of sorting needs something that reads the email, which is what an AI assistant like Construct does.
Is anything I type sent to Construct?
No. The generator builds the search strings and the XML file in your browser, and this part of the page is excluded from our analytics and session recordings. We only count that a file was copied or downloaded, never what was in it.
More free tools
- AutomationZapier cost calculatorHow much will Zapier cost you? Enter your Zaps, steps and runs to see your monthly tasks, the cheapest plan and your cost per task, at current Zapier prices.
- AI setupMCP config generatorGenerate mcp.json and MCP config for Claude Desktop, Claude Code, Cursor, VS Code and Codex from one server. Local or remote, env vars and headers. Free.
Related reading
- How to Give an AI Agent Its Own Email Address
Three ways to give an AI agent its own inbox: a product with a native agent address, a developer email API, or delegated Gmail access. Trade-offs and steps.
- AI Employee for Real Business Work
Meet the AI employee that researches, operates tools, creates files, and runs recurring work from a persistent, supervised workspace.