📄 gmail-search-syntax.md

← Vault

Gmail Search Syntax

Standard Gmail search operators work in the query argument.

Common Operators

Date Operators

Combining

OperatorExampleDescription
--------------------------------
is:unreadis:unreadUnread messages
is:starredis:starredStarred messages
is:importantis:importantImportant messages
in:inboxin:inboxInbox only
in:sentin:sentSent folder
in:draftsin:draftsDrafts
in:trashin:trashTrash
in:anywherein:anywhereAll mail including spam/trash
from:from:alice@example.comSender
to:to:bob@example.comRecipient
cc:cc:team@example.comCC recipient
subject:subject:invoiceSubject contains
label:label:workHas label
has:attachmenthas:attachmentHas attachments
filename:filename:pdfAttachment filename/type
larger:larger:5MLarger than size
smaller:smaller:1MSmaller than size
OperatorExampleDescription
--------------------------------
newer_than:newer_than:7dWithin last N days (d), months (m), years (y)
older_than:older_than:30dOlder than N days/months/years
after:after:2026/02/01After date (YYYY/MM/DD)
before:before:2026/03/01Before date
SyntaxExampleDescription
------------------------------
spacefrom:alice subject:meetingAND (implicit)
ORfrom:alice OR from:bobOR
--from:noreply@NOT (exclude)
()(from:alice OR from:bob) subject:meetingGrouping
"""exact phrase"Exact phrase match

Common Patterns

`

Unread emails from the last day

is:unread newer_than:1d

Emails with PDF attachments from a specific sender

from:accounting@company.com has:attachment filename:pdf

Important unread emails (not promotions/social)

is:unread -category:promotions -category:social

Emails in a thread about a topic

subject:"Q4 budget" newer_than:30d

Large attachments to clean up

has:attachment larger:10M older_than:90d

`