Advanced Automation · 9 min read · 2026-05-13
How to Delete Old Emails with Specific Keywords from One Domain
Combine domain filters, date parameters, and subject keywords to create the ultimate highly-specific Gmail deletion automation.
Surgical Precision: Preserving Signal While Eliminating Noise
In professional communications, email rarely falls into neat black-and-white categories. You often work with essential clients, software vendors, or project partners where some emails are mission-critical, while others are pure temporary noise.
Consider these real-world scenarios:
- Enterprise Software Vendors (e.g., Jira, Asana, GitHub): You receive critical security alerts and account notices from
@company.com that you must keep forever. But you also receive hundreds of automated notifications with the subject "Daily Digest" or "Issue Updated" that lose all value after 30 days. - Key Clients & Freelancers: A client sends vital invoices, contracts, and scope-of-work agreements from
@client.com. But during active sprints, they also send hundreds of automated messages with the subject "Status Update" or "Standup Notes". - Logistics & E-Commerce Partners: You receive tax invoices and warranty records from
@vendor.com, but they also send recurring emails with the subject "Shipping Status" or "Tracking Update".
If you delete all emails from that sender, you destroy critical business records. If you do nothing, temporary status updates accumulate into thousands of clutter emails.
To solve this, you need a 3-point intersection filter: Domain + Subject Keyword + Age Threshold.
In this guide, we show you how to execute this query manually in Gmail and how to configure an automated Playbook using Smart Mailbox Cleaner.
The Manual Way: Gmail Search Operators for Domain and Keyword
To isolate old emails containing specific keywords from a single domain, construct a compound query in Gmail.
1. The Core 3-Point Search Operator
In the Gmail search box, enter:
from:(*@clientcorp.com) subject:"Status Update" older_than:30d
Let's break down this syntax:
from:(*@clientcorp.com): Restricts the search strictly to emails originating from this specific domain across all aliases.subject:"Status Update": Targets only conversations containing that exact contiguous phrase in the subject line.older_than:30d: Preserves recent status updates from the past month, giving you ample time to reference active project notes.
2. Chaining Multiple Status Keywords with Safety Exclusions
If the sender uses multiple repetitive status phrases, combine them with OR while explicitly excluding financial keywords:
from:(*@clientcorp.com) subject:("Status Update" OR "Daily Sync" OR "Standup Notes") older_than:30d -subject:invoice -subject:contract -is:starred
3. Executing the Manual Deletion
- Press Enter to run the search in Gmail.
- Click the select-all checkbox at the top-left of the message view.
- Click the blue link: "Select all conversations that match this search".
- Click the Trash icon.
- If you need storage space immediately, empty your Gmail Trash.
Why Native Gmail Filters Cannot Automate This
While you can create a native Gmail filter for from:clientcorp.com subject:"Status Update" that triggers the "Delete it" action, it will delete status updates the instant they arrive. You will never see the daily status update when it is actually needed. Because native Gmail filters cannot enforce an age buffer like "delete only if older than 30 days", native automation is completely impractical.
The Smart Way: Custom Scan Builder Step-by-Step Configuration
Smart Mailbox Cleaner provides the exact age-buffered automation engine required for this surgical workflow.
Step-by-Step Query Setup in Custom Scan Builder
Follow these exact steps to configure your scan:
Step 1: Open Custom Scan Builder
Sign in to your Smart Mailbox Cleaner Dashboard and navigate to the Custom Scan Builder.
Step 2: Configure the Domain Parameter
- In the Sender field, enter the domain format:
@clientcorp.com.
Step 3: Configure the Subject Keyword
- In the Subject / Keyword field, enter the exact target phrase enclosed in quotes:
"Status Update".
Step 4: Set the Age Parameter
- In the Date / Age selector, choose "Older than 30 Days" (or 60/90 days depending on your project duration).
Step 5: Enable Safety Protections
- Under Protections, ensure "Exclude Starred" and "Exclude Important" are checked.
- Optionally add a negative label exclusion for any custom Gmail project labels.
Step 6: Review Live Exact Metrics in Preview
Check the real-time panel on the right side of the screen:
- Target Match Count: Displays the exact count (e.g.,
214 conversations). - Storage Space Recoverable: Displays the exact megabyte savings (e.g.,
340 MB). - AI Confidence Rating: Our engine verifies that none of the matching conversations include invoice attachments or active client contract signatures.
- Click "Expand Preview" to inspect a sample list of matching subject lines and confirm that only aged status updates are selected.
Step 7: Save as an Automated Playbook
Click "Save as Playbook":
- Name: "Monthly Clean: [Domain] Status Updates".
- Schedule: Set to Run Monthly (1st of every month).
- Click "Activate Playbook".
How the Playbook Operates on Autopilot
With this Playbook active:
- On the 1st of every month, Smart Mailbox Cleaner executes the query via server-side API calls.
- Any email from
@clientcorp.com containing "Status Update" that has crossed the 30-day mark is moved to Trash. - Recent status updates remain accessible during active sprints.
- Critical contracts, invoices, and general correspondence from the client are completely protected forever.
Native Gmail Filters vs. Smart Mailbox Cleaner Playbooks
| Feature | Native Gmail Filters | Smart Mailbox Cleaner Playbook |
|---|
| Domain + Keyword Support | Yes (Available in filter creator) | Yes (Visual multi-slider interface) |
| Age Buffering (Older than X Days) | Impossible (Deletes immediately on delivery) | Fully supported (Rolling dynamic date windows) |
| Exact Count Verification | Blind guessing | Exact database count displayed via API |
| Undo Safety | Messy Trash restoration | 1-Click 30-Day Undo with label preservation |
| AI Risk Assessment | None | Automated transactional header protection |
Complete Safety and 30-Day Undo
We understand that working with corporate domains requires absolute precision. Smart Mailbox Cleaner provides complete safety nets:
- Metadata-Only Processing: We only access email metadata — sender, date, size, labels. We never read email content. We never access message bodies or confidential project documents.
- 30-Day Undo Guarantee: If an automated Playbook ever deletes a status update thread you need for an audit, visit your History Dashboard and click Undo. The entire batch is restored to its original Gmail folders with all labels intact.
- Transparent Pricing: Test your query — first cleanup free, or choose Starter (₹149/mo), Pro (₹349/mo), or Power (₹699/mo) on our Pricing Page.
Prune company noise while protecting your critical signal. Build your 3-point Playbook today on Smart Mailbox Cleaner.
Related Reading
Frequently Asked Questions
How can I ensure critical contract emails from this domain are never touched?
Because the query specifically targets the exact subject phrase (e.g. subject:"Status Update"), any email with a different subject line (such as "Contract", "Agreement", or "Invoice") is completely ignored by the query.
Does the subject keyword search match variations like "Weekly Status Update"?
If you use exact phrase matching with quotation marks like subject:"Status Update", it will match any subject containing those two words in order, including "Weekly Status Update" and "Status Update - Project Alpha".
Can I chain multiple keywords together in the subject rule?
Yes. In native Gmail, use boolean operators like subject:("Status Update" OR "Daily Sync"). In Smart Mailbox Cleaner, you can include multiple keyword variations in your custom query.
Why shouldn't I use Gmail's native auto-delete rules for this?
Native Gmail auto-delete rules execute at the exact instant an email arrives. They cannot enforce an age buffer. If you set a native rule for "Status Update", you will never see the update when it is fresh and relevant.
What happens if the sender modifies their subject line formatting slightly?
If the sender changes their subject line to something that does not match your keyword rule, the email will simply remain in your inbox. It will never be deleted erroneously.
Try Smart Mailbox Cleaner free →