This is a small trick I learned the hard way. When working through the massive amounts of emails, I often wondered: how to get only the unread ones in Gmail that are also in the primary tab?
Queries like these happen quite frequently when working with Gmail. As it turns out, there’s a simple solution:

Simply type the following command in your search bar:
in: category:primary is:unread
For coders, this is an easily understandable filter operation. We want to retrieve all emails from your inbox (in:
) that are also in your primary tab (category:primary
) and that are also unread (is:unread
).
As it turns out, Gmail comes with powerful filtering options even way beyond what you’ve seen here. Here are all the search and filtering operators in Gmail (screenshot from this source):

Simply bookmark this page and come back if you run into the next Gmail search issue.

While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com that has taught exponential skills to millions of coders worldwide. He’s the author of the best-selling programming books Python One-Liners (NoStarch 2020), The Art of Clean Code (NoStarch 2022), and The Book of Dash (NoStarch 2022). Chris also coauthored the Coffee Break Python series of self-published books. He’s a computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.