Viewing Gmail Messages with No Label
I’ve been experimenting more with Gmail after my disappointing Zimbra experience (I haven’t totally written Zimbra off though, I’m just letting it mature in the cask for a while – the ultimate winner will be the first to allow offline use of Contacts and provide reliable contact synchronization). Anyway, aside from Gmail not having a decent way to delete a message without get kicked back to the message list (instead of just going to the next message like every other email client on the planet, there is also the annoying fact that in Gmail there’s no button to just view messages with no label. In their wisdom, the Google people no doubt think that I’ll be using their wonderful search engine to just search and find the messages I want and locate the relevant message. But as the great Donald Rumsfeld said, there are known unknowns (I can search for those) and unknown unknowns like the credit card bill that I totally forgot about and which I could search for if I knew I had forgotten about it, but then I wouldn’t have forgotten about it and wouldn’t need to search for it now would I?
So the way you find emails that have fallen through the cracks in Gmail is simple, but os so cumbersome. You have to do a negative search for every label you use. That is, you look for messages not labelled Labe1 and not labelled Label2 and so on. There’s no way around this.
If you do this more than once, typing in all your labels in the arcane syntax Gmail uses gets old. So what I’ve done is simply create a shortcut, which you can do quite easily and it works up until you add a new label, but then it’s just a simple matter of editing the bookmark.
So first, you have a full syntax and a compact syntax and, as far as I can tell, the compact syntax does not work with multi-word labels. So if you have Gmail labels with spaces in them, you have to use the full syntax and substitute hyphens for spaces.
So let’s say you have the following labels:
- Label1
- Label2
- Label Three
- Label Four
First, we want to exclude all messages that have those labels. To exclude a labeled message from your search, you use the -label: operator.
For the single-word labels, we’ll use the short syntax. This allows you to group terms within curly braces without repeating the “-label:” qualifier. So it looks like this in your Gmail search box
-label:{Label1 Label2}
Simple as that. Now for the multi-word labels, in theory as I read the instructions, I merely need to add quotes around the terms, and they should work within the curly braces. Not so for me. If you create a filter and look at the test search, that’s not how it does it either. So based on that, what I found worked for Label Three and Label Four was:
-label:Label-Three -label:Label-Four
So the entire search, with both single-word labels and multi-word labels, looks like this
-label:{Label1 Label2} -label:Label-Three -label:Label-Four
Now, that will create a URL that looks like this
http://mail.google.com/mail/#search/-label%3A%7BLabel1+Label2%7D+-label%3ALabel-Three+-label%3ALabel-Four
Now you can save this as a bookmark or shortcut and instantly access your unlabeled Gmail messages. Sometimes Gmail will add a zx parameter to your URL that looks like zx=afeoasdxou3swf that is just a random string so that if your ISP is caching data, it will see this as a unique URL and won’t give you cached data for Gmail. Since this effectively creates a single-use URL, if that appears in your URL when you do your search, you should edit it out before saving the bookmark.
Note that if a message has two labels and you are only excluding one of those, the message will still show up in your search. So if you have something labeled Label1 and Label5, and you use the search above, it will still show up in your results.
Also, sometimes a conversation that is labeled shows up unless you relabel the entire conversation, because one message is unlabeled or is still in the Inbox or whatever. If you select the whole conversation in the list view and label it, that takes care of that issue.
Filed under: Software and Computing • Web Fun
Like this post? Subscribe to my RSS feed and get loads more!

I can’t get your solution to work. I have been trying all night and I can’t get Gmail to subtract more than two labels from the search. If I subtract the labels “friends” and “family” then no matter what netative search I put next, it will not recognize it and come up with a proper list. I could live without being able to subtract all the labels, but there are three major labels I use, and in order to find the unlabeled messages, even by hand, I need to remove these other three labels. It’s very frustrating.
Sorry Jill. It can be frustrating and maybe I haven’t explained it well. It took me a lot of tries.
If you post your list of labels, I’ll see if I can’t get it to work right.
Thanks for the tip. Just what I was looking for.
But regarding:
“aside from Gmail not having a decent way to delete a message without get kicked back to the message list (instead of just going to the next message like every other email client on the planet”
Just for the record, there are people (at least one?) that prefers this behavior. I selectively scan and read my inbox, leaving unread the messages I may not want to deal with at the moment. Many (most) of these can be determined just from sender/subject.
Thanks Matt. I’m sure you’re not the only one as the designers must really like it this way and my nephew thinks the gmail interface is near perfect. I would just love it have it as a setting (i.e. action to take on deleting current message).
I hope the unlabelled message thing works for you. It didn’t work for Jill and I tried to help by email, but I just couldn’t get my method to work for her.
Thanks a million for this it really helps.
What I found annoying was that it was also bringing in all my chat logs. I found starting the search queury with in:inbox solved this.
So my search looks like this:
in:inbox -{label:Label1 Label2 Label-three}
thanks!
I also remember there being a greasy monkey script that would add a shortcut to your list of labels and call it “unlabeled”, clicking it would lists all the unlabeled messages.
I haven’t tried it yet, but you’re right, there is a Greasemonkey script (two actually).
http://userscripts.org/scripts/show/13937
http://userscripts.org/scripts/show/36752
Tom – thanks for the post. I was initially hestitant to do it as i had 50+ labels and finally tried it. It worked as expected.
Thanks for this!
You might be interested to know that slashes (/) for subfolders also get replaced by hyphens, so to exclude ‘top folder/subfolder’ you would use ‘-label:top-folder-subfolder.
Square brackets don’t get changed though, so to exclude ‘[Imap]/Drafts’, you would use ‘-label:[imap]-drafts’.
Thanks guys and thanks Chris for that tip!
If I’m reading your lament about deleting messages correctly, and you actually mean archive, try using “[” while in a message. It archives the messages and goes to the next one. If not, never mind.
No Sam, I don’t mean archive. Archive is Archive and Delete is Delete.
I don’t want to archive spam mails, non-spam mass mails about Home Depot’s Labor Day sale, one-line mails from a friend where someone says “Okay, Sunday at 7:30 then” which are useless come 7:31 on Sunday. I suppose I would also delete embarrassing and incriminating emails if I had any of those, though I try to not write those in the first place!
Ideally, I want messages that only have some information that I could conceivably care about cluttering up my archives.
The trick to find ONLY the unlabeled mails (neither those emails who are in a conversation)
The method is the following:
Step 1: Seach for mails containing all labels using the OR-operator (ie. label:label1 OR label:label2 OR label:label3 etc.)
Step 2: Star al these conversations.
Step 3: create a new label (ie. LABELWITHOUTSTAR)
Step 4: Seacht for conversations without a star ( -is:starred)
Step 5: Select al these conversations and apply the LABELWITHOUTSTAR label.
Finished!
Hey Wander,
Thanks for the tip.
The problem with that is that you have to do it every time, and then you also have to use stars that way.
Once you set it up, my method gives you one-click access to all those messages without any other steps.
Which method you prefer would depend on how often you do this. If you do it a lot, it’s worth the overhead to set up my method. If you just want to do it rarely, then your method is probably less effort overall.
The way not to do it every time and make only unlabelled messages show:
1 – Create a label and call it UNLABELLED for instance
2 – Create a filter with the following code in the “Doesn’t have:” space:
l:label1 OR l:label2 OR l:label3 OR …. OR from:me OR in:chat (replacing label1, label2, etc with the names of your labels)
3 – Click “Next step >>” and in “Apply the label:” choose UNLABELLED or whatever name you’ve given to your new label in step 1.
4 – Click “create filter”.
5 – From now on to see only unlabelled messages click on UNLABELLED label.
Hmm, maybe I’m missing something, but I think I have a better solution :-) (Ok, I’m probably totally missing something, but here goes)
The Skip-Inbox-mehod.
The idea is do this all “backwards”: Let *no* email with a Label applied end up in the “Inbox”. The Inbox will be that interesting place where you notice those unknown unknowns — only *unlabeled* messages end up there.
To emulate the functionality of the regular Inbox (now that we’ve sort of “ruined” the real one), use a new Label called TheBigInbox.. and a create a new Filter that will apply that Label to *all* messages:
* Matches: from:(*)
* Do this: Apply label “TheBigInbox”
Why is this better? Well, it’s *easier* to tell each Filter (that applies a Label) to “Skip Inbox” than to enumerate all Labels (handling spaces and using curly braces and whatnot) in a query. And when a new Filter (Label) is created, there is no need to edit that cumbersome search query with curly braces and all, just tell it to “Skip Inbox” — that’s all! This should be more maintainable, right? Two examples:
== The following filters are applied to all incoming mail: ==
* Matches: from:(webmaster@donaldrumsfeld.com)
* Do this: Skip Inbox, Apply label “Donald”
* Matches: list:”known-unknowns.com”
* Do this: Skip Inbox, Apply label “known-unknowns”
Thanks,
– Hugo