Define which messages should match
Choose a reliable sender, domain, subject phrase, recipient, category, attachment, or other condition. Avoid adding uncertain details only to make the rule look precise.
Build the search criteria for a Gmail rule, test which messages match, and then create a filter in Gmail without guessing at operator syntax.
Choose the messages a filter should match. The builder creates a testable Gmail query before you apply labels, archive, mark, forward, or delete anything.
Gmail calls inbox rules filters. Every filter starts with search criteria: a sender, recipient, subject, phrase, date, category, attachment, size, or a combination of those conditions. Use the builder above to create that criteria as a visible Gmail query.
Test the query in Gmail before creating the rule. When the results contain only the messages you intend to automate, open Gmail's advanced search, use the same criteria, select Create filter, and choose the action. This test-first workflow reduces accidental archiving, labeling, forwarding, or deletion.
Choose a reliable sender, domain, subject phrase, recipient, category, attachment, or other condition. Avoid adding uncertain details only to make the rule look precise.
Open the query in Gmail and inspect several results. If unrelated mail appears, add one condition. If expected mail is missing, remove the least reliable condition.
Open Gmail's search options, enter or paste the tested criteria, select Create filter, choose the actions, and decide whether the rule should also apply to matching conversations already in the mailbox.
Each example begins with criteria that can be tested as an ordinary search before any automatic action is enabled.
People often search for Gmail rules because Outlook and other email services use the word rule. In Gmail, the equivalent feature is called a filter. A filter checks incoming mail against search criteria and then performs one or more selected actions.
The search query is the matching layer, not the action itself. InboxQuery helps build that matching layer. Gmail remains the place where you choose whether to apply a label, skip the Inbox, mark as read, star, forward, delete, categorize, or avoid Spam classification.
Apply a label when messages need a visible category. Skip the Inbox when mail should remain searchable but does not need immediate attention. Mark as read is useful for predictable automated notices, while Star can highlight a narrow set of important messages.
Forwarding, deletion, and Never send it to Spam have larger consequences. Confirm the sender and recipient conditions carefully. Forwarding must use an address configured and verified in Gmail, and a deletion rule should be tested with representative messages before it is allowed to process future mail.
Gmail uses labels rather than traditional folders. To reproduce a folder-style rule, create or select a label and combine Apply the label with Skip the Inbox. The message will leave the Inbox view while remaining available under the label and in All Mail.
If a message needs to remain visible in the Inbox, apply the label without Skip the Inbox. A message can have several labels at once, which is different from systems where one message can occupy only one folder.
First, copy the filter criteria into Gmail search. If the search does not return the expected message, the criteria—not the selected action—is the likely problem. Check the actual sender address, aliases, plus-addressing, subject wording, categories, date boundaries, and whether separate conditions accidentally require all values to match.
If the search works but new mail is not processed, review Settings, See all settings, Filters and Blocked Addresses. Confirm that the filter exists, its actions are enabled, forwarding is verified when used, and another filter is not producing a confusing result. Filters normally act on incoming messages; older mail changes only when you select the option to apply the filter to matching conversations during setup or run an equivalent manual action.
Use sender and recipient addresses, subject text, included words, an exact phrase, and comma-separated exclusions. Blank fields remain outside the query, so you can work with incomplete information.
Combine a fixed date range or rolling message age with read status, mailbox location, Gmail category, attachment presence, filename, and complete-message size limits.
The result is standard query text for Gmail’s search box. InboxQuery also describes each fragment, flags conflicting boundaries, offers one-click copying, and creates a direct Gmail search link.
Begin with the condition you know is true. That may be a sender address, a broad date window, an attachment type, or a mailbox location. Run that simple query first. When the result contains the target but is too large, add one more condition. This incremental method is easier to debug than starting with a long query made from several uncertain memories.
If a query returns nothing, remove the condition you trust least. Display names can hide a different sender address, subject wording may not be exact, categories can be assigned unexpectedly, and date boundaries can exclude messages near midnight. Switching to in:anywhere is useful when Spam or Trash may contain the message, but it does not search another account or restore permanently deleted mail.
The builder handles empty, valid, and invalid states without contacting Gmail. A blank form shows a clear empty result. A valid combination enables copy and search actions. Reversed date boundaries, non-positive age values, and an impossible size band display an error and disable the actions until the input is corrected. Gmail—not InboxQuery—decides which existing messages match the finished query.
Copying the query is useful when you want to inspect or edit it in Gmail before searching. The direct link is faster when the generated text already matches your intent. Both actions use the same visible query, and neither grants InboxQuery permission to your account. Rolling age filters change over time, while fixed dates continue to describe the same period.
Record what each filter should match, which actions it performs, and how it was tested. Review rules that forward mail, delete messages, bypass Spam, or route account and billing notices. Sender domains, aliases, and filing needs change, so an old rule may become too broad or too narrow. Re-test the criteria as a normal search before editing a high-impact action.
Yes. Gmail calls them filters. Filters match messages using search criteria and then apply actions such as labels, archiving, marking as read, starring, forwarding, or deletion.
Build and test the matching search, open Gmail's advanced search options, choose Create filter, select the actions, and save the filter.
In desktop Gmail, open Settings, choose See all settings, and select Filters and Blocked Addresses. From there you can edit, delete, import, or export filters.
The Gmail mobile apps can run searches, but full filter creation and management is generally handled in desktop Gmail or a desktop browser view. Test the query on mobile, then configure the filter in the full settings interface.
Test its criteria as a Gmail search. Then check sender aliases, AND conditions, filter actions, verified forwarding, overlapping filters, and whether the rule was expected to affect older conversations.
Gmail uses labels. Apply a label and select Skip the Inbox to create folder-like routing while keeping the message available under the label and in All Mail.
Operator syntax is based on Google's official guide to creating Gmail filters. InboxQuery is independent and does not access your account.