Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active July 30, 2025 14:43
Show Gist options
  • Select an option

  • Save wilmoore/d8f31b08ea0398540d4d6f40d014fa49 to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/d8f31b08ea0398540d4d6f40d014fa49 to your computer and use it in GitHub Desktop.
Productivity :: Software :: Google Workspace :: Gmail :: Search :: Operator

Productivity :: Software :: Google Workspace :: Gmail :: Search :: Operator

βͺΌ Made with πŸ’œ by realpolyglot.com

related

Basic Search Operators

  • from: – Find emails sent from a specific person.

    • Examples: from:me, from:amy@example.com
  • to: – Find emails sent to a specific person.

    • Examples: to:me, to:john@example.com
  • cc:, bcc: – Find emails that include specific people in the "Cc" or "Bcc" fields.

    • Examples: cc:john@example.com, bcc:david@example.com
  • subject: – Find emails by a word or phrase in the subject line.

    • Examples: subject:dinner, subject:anniversary party

Date-Based Search

  • after:, before:, older:, newer: – Search for emails received during a certain time period.

    • Examples: after:2004/04/16, before:2004/04/18
  • older_than:, newer_than: – Search for emails older or newer than a time period. Use d (day), m (month), or y (year).

    • Examples: older_than:1y, newer_than:2d

Logical Operators

  • OR or { } – Find emails that match one or more of your search criteria.

    • Examples: from:amy OR from:david, {from:amy from:david}
  • AND – Find emails that match all of your search criteria.

    • Example: from:amy AND to:david
  • - – Exclude emails from your search criteria.

    • Example: dinner -movie

Proximity Search

  • AROUND – Find emails with words near each other. Use the number to say how many words apart the words can be.
    • Examples: holiday AROUND 10 vacation, "secret AROUND 25 birthday"

Labels and Categories

  • label: – Find emails under one of your labels.

    • Examples: label:friends, label:important
  • category: – If you use inbox categories, find emails under one of the categories.

    • Examples: category:primary, category:social, category:promotions, category:updates, category:forums, category:reservations, category:purchases

Attachments and File Types

  • has: – Find emails that include:

    • Attachments: has:attachment
    • Inline images: has:image
    • YouTube videos: has:youtube
    • Drive files: has:drive
    • Google Docs: has:document
    • Google Sheets: has:spreadsheet
    • Google Slides: has:presentation
  • filename: – Find emails that have attachments with a certain name or file type.

    • Examples: filename:pdf, filename:homework.txt

Mailing Lists and Message IDs

  • list: – Find emails from a mailing list.

    • Example: list:info@example.com
  • rfc822msgid: – Find emails with a specific message-id header.

    • Example: rfc822msgid:200503292@example.com

Exact Matches and Grouping

  • " " – Search for emails with an exact word or phrase.

    • Example: "dinner and movie tonight"
  • ( ) – Group multiple search terms together.

    • Example: subject:(dinner movie)
  • + – Find emails that match a word exactly.

    • Example: +unicorn

Special Folders and Status

  • in:anywhere – Find emails across Gmail, including Spam and Trash.

    • Example: in:anywhere movie
  • in:snoozed – Find emails that you snoozed.

    • Example: in:snoozed birthday reminder
  • is:muted – Find emails that you muted.

    • Example: is:muted subject:team celebration
  • is: – Search for emails by their status:

    • Important: is:important
    • Starred: is:starred
    • Unread: is:unread
    • Read: is:read

Starred Emails

  • has:yellow-star, has:orange-star, has:red-star, has:purple-star, has:blue-star, has:green-star, has:red-bang, has:orange-guillemet, has:yellow-bang, has:green-check, has:blue-info, has:purple-question – If you set up different star options, you can search for emails under a star option.
    • Example: has:yellow-star OR has:purple-question

Delivery and Size

  • deliveredto: – Find emails delivered to a specific email address.

    • Example: deliveredto:username@example.com
  • size:, larger:, smaller: – Find emails by their size.

    • Examples: size:1000000, larger:10M

Labels Presence

  • has:userlabels – Find emails that have user-applied labels.
  • has:nouserlabels – Find emails that don't have user-applied labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment