Finding Gmail Messages with No Label | Raised By Turtles

You want all your gmail messages to have a label, maybe several. maybe you need to clean up a bunch of junk and your unlabeled email is usually not important. so you want to search for unlabeled gmail messages.

easy, right? just look in has:nuserlabels (see method 2 below). unfortunately this still doesn’t work reliably for me (updated March 2019). will include many tagged email threads.

so how do you find a gmail message without a tag?

There is no simple button you can press. but you don’t want to read the whole set of emails manually, do you?

A little filter magic will solve this in no time.

This is a fairly long article, so I’ve organized it into sections. Click on any of the links below to go directly to the section that solves your problem. (note: I update them periodically to incorporate new user comments).

Below the links is a preface about my original motivation and my current feeling about tagging or not.

jump to quick answers:

  • method 1: simple and mostly reliable
    • -has:userlabels -in:sent -in:chat -in:draft -in:inbox
    • has:noserlabels -in:sent -in:chat -in:draft -in:inbox
    • -label:{label1 label2} -label:label-three -label:label-four -in:sent -in:chat -in:inbox
    • find everything with any label (has:userlabels), apply a new label to all found messages, and then search for messages with no labels. this can help with some of the issues related to talk mode.

    advanced topics and related problems

    • conversation mode and tags
    • understanding gmail filters
    • multi-word tags are a bit more complex
    • save your search for later use
    • additional operators and pseudo-tags
    • tag your backlog
    • deal with secondary tags and tags with special characters
    • deal with large-scale operations (many tags or many messages)

    community contributions

    • go to user feedback
    • we need your feedback: email in general, what is your biggest pain point. let me know.

    preface: to tag or not to tag

    why do we want to find untagged emails?

    I guess if you’ve made it this far, you already have your reasons. but you may be wondering, why be so obsessive?

    a couple of possible reasons:

    • you may want to import from another account or something. so it tags everything currently in your account with “main” and then when it imports it finds all the untagged messages, tags them as “imported”, and then removes the “main” tag.
    • he just likes everyone to have a label because you’re that kind of person.

    I’ll be honest: when I wrote this, I wanted everything to have a label. why? because in the past I had used clients like thunderbird and outlook that had the concept of folders, but no labels. the inbox is just a folder. so if you want to get something out of your inbox, it has to go to a different folder.

    gmail is different

    gmail is different. for one, the search function is really good. this means that you are more likely to find something through search than by digging into folders/tags.

    In short, I don’t use this method anymore. instead, I have a manageable number of tags and plenty of filters. most recurring emails are automatically labeled and then archived when needed. I tag things I need for taxes or with a project name, but usually I have a filter that only applies the tag. So I depend on the search. automate what you can. forget about 90% of the rest.

    That’s not to say that people don’t have very good and compelling reasons for wanting to find unlabeled messages, but you might be wondering if you’re bringing an outlook/thunderbird mentality into gmail and just let it slide. .

    I originally wanted everything to be labeled, but I was wrong. What I found was that I was better at remembering conversational keywords than remembering tags, and searching for conversational keywords is google’s core competency. I decided that organizing my email manually was a waste of time and an IBM study confirms this.

    Yes, I have been assimilated by the gorg!

    quick version: gmail filters to find untagged messages

    This article has evolved a lot with the evolution of gmail and I’ve tried to streamline it a bit and get to the point (it was riddled with outdated “updates”). here is the short answer. If you want to understand what these filters mean, how we came up with them, or how to use them, scroll down to see the original article that gives all the practical and theoretical background on custom gmail filters.

    alright, show me the method!

    method 1: simple and mostly reliable

    still on 1st Jan 2018 as I edit this, the best method currently seems to be to exclude anything that has custom tags or one of the standard built in tags as follows (thanks tony franks for the comment of 2013-07-01):

    -has:userlabels -in:sent -in:chat -in:draft -in:inbox

    ron wolf suggests in the comments (November 29, 2016), adding -from:me to the search to avoid receiving your own messages. I find these are the ones that often go untagged and are the ones I’m looking for, but again, it all comes down to how you use gmail.

    simply enter these searches in the search box, click the select all checkbox, and then click the link to select all the messages that match your search, as in the screenshot below (click click to see full size):

    You’ll notice that at the bottom of the screenshot, the last item is in the inbox and shouldn’t be found. that’s part of a multi-participant threaded conversation where people don’t use reply all. that seems to result in gmail seeing some of the threads with some participants as archived and meeting the search criteria. so it’s not perfect.

    method 2: simple but not very reliable.

    if that doesn’t work, you can try a jong method posted 2013-01-14. unfortunately, that method seems to be flaky for many people. it used to be that it never worked for me, but now (March 2019) I think it works just as well as method 1, but seems to reveal a few more false positives:

    has:nouserlabels -in:sent -in:chat -in:draft -in:inbox

    method 3: very reliable but a headache

    My original method was more labor intensive, but at the time, the special “userlabels” and “nuserlabels” pseudo-labels weren’t available, so I had to painstakingly create a search and save it for future use. this method is a pain in the neck, but it works reliably precisely because it doesn’t actually depend on any tag with any special meaning. the catch is that you can combine single-word tags in curly braces, but multi-word tags need their own input with spaces replaced by hyphens, like so:

    -label:{label1 label2} -label:label-three -label:label-four -in:sent -in:chat -in:inbox

    If you do this more than once, writing all your tags in the arcane syntax that gmail uses becomes obsolete. so what i’ve done is just create a shortcut (aka bookmark), which you can do pretty easily and it works until you add a new tag, but then it’s just a matter of editing the bookmark.

    method 4: desperate measures

    finally, if all else fails, you can use this indirect method from federico (comment 06-08-2013):

    • first find each post that has a label (has:userlabels)
    • label all results with a new “tagged” label (or whatever you want)
    • now look for has:nouserlabels
    • ba dum, you got them!
    • remove your “tagged” tag.

    using tag manager to find all tags

    thanks to commenter chris who alerted me to a new google spreadsheets plugin called tag manager. basically it allows you to connect your gmail or gsuite account to a google sheet and extract all the tags into a spreadsheet. you can also do things like rename your tags and move a child tag to a parent tag.

    chris describes how he uses this to put the tags into a format that can be used in filters:

    for example, once I had all my tags in one column, I lowercase them with the formula =below. I then copied and pasted into a new column so I could find spaces in my labels and replace them with hyphens (-). then I just used the =concatenate formula to make the “-label:” part and then another =concatenate to merge them into a usable string. it took about 2 minutes for 158 tags.

    You can do this on a single line without cutting and pasting. assuming your labels are in cells a1:a100, your google sheets formula would look like this:

    basically, working from the inside out, you make the tags lowercase and replace spaces with hyphens throughout the range (ie, use the array formula). then join each cell with text, using “-label:” as the join text (note the leading space in “-label”). since this doesn’t “attach” anything to the front, it’s missing a tag and we wouldn’t want the leading space there anyway. so finally, you need to prepend (concatenate) your leading “-tag:” (note the lack of leading space). in textjoin we set the second parameter to true so that if there are empty rows, they are skipped. and there you have it: you should have all the negated tags in one giant filter.

    conversation mode and tags

    with all methods, danimal suggests disabling chat mode (threaded conversations), as this can create confusion.

    I like to leave conversation mode on because I usually just want to capture full conversations without tagged messages. if any message in the thread is tagged, that’s enough because I’ll find the conversation via the tag.

    but if you don’t want to find untagged threads, but all individual untagged posts, then you should do what danimal says.

    details: understanding gmail filters

    has a full syntax and a compact syntax and, as far as I know, the compact syntax doesn’t work with multi-word tags. so if you have gmail tags with spaces, you should use the full syntax and replace hyphens with spaces.

    so, let’s say you have the following tags:

    1. tag1
    2. tag2
    3. tag three
    4. tag four

    First, we want to exclude all posts that have those tags. To exclude a tagged message from your search, use the -label: operator.

    for single-word tags, we’ll use the short syntax. this allows you to group terms in curly braces without repeating the “-label:” qualifier. so it looks like this in your gmail search box

    -label:{label1 label2}

    as simple as that.

    multi-word tags are a bit more complex

    Now for the multi-word tags, in theory, I just need to add quotes around the terms, and they should work inside the curly braces. it’s not like that for me. if you create a filter and look at the test search, it doesn’t either. based on that what i found worked for tag three and tag four was:

    -label:label-three -label:label-four

    so the full search, with both single-word tags and multi-word tags, looks like this

    -tag:{tag1 tag2} -tag:tag-three -tag:tag-four

    now, that will create a url that will look like this

    save your search for later use

    You can now 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 which is just a random string so if your isp is caching data , it will see this as a unique url and will not give you cached data for gmail. Since this effectively creates a one-time url, if it appears in your url when you do your search, you must edit it before saving the bookmark.

    Note that if a post has two tags and you only exclude one of them, the post will still appear in your search. so if you have something tagged as tag1 and tag5, and you use the above search, it will still show up in your results.

    also, sometimes a tagged conversation appears because a message is not tagged or is still in the inbox. if you select the entire conversation in the list view and the label, that fixes that problem.

    additional operators and pseudo tags

    As you saw above, there are additional operators (in and has) and special built-in pseudo-tags (user tags).

    Depending on what you’re trying to do, you can narrow or refine your search using any of the built-in tags (inbox, trash, etc.) and user tags.

    • -in:inbox (doesn’t find anything if it’s still in the inbox)
    • in:trash (if you want to search the gmail trash, you need a special operator because the default is excluded)
    • in:anywhere (allows you to do a search that includes spam, junk, inbox, and, well, messages found anywhere)
    • -has:userlabels should be the same as has:nuserlabels, but in practice people report that they are not.

    there are many more options. see the google gmail tag documentation for a complete and up-to-date list.

    tagging your backlog

    per karen’s suggestion below (see comments), if you’re trying to identify your unlabeled email just once and label your backlog, you can view all of it, apply a label to it like “nolabel” (or move them all to the inbox as karen suggests).

    now go to all the other tag folders, select them all and remove the “no tag” tag (or archive them if you put them in the inbox). now if you go to the nolabel folder you have all your email unlabeled. however, if you’re going to be doing this on a regular basis, you’ll want a bookmark as described above, otherwise it’ll take quite a bit of time.

    dealing with secondary tags and tags with special characters

    james asks, what if you have special characters like underscores or slashes in your gmail tags? if you are using gmail’s sub tag feature it will automatically have forward slashes because gmail separates parent and child tags with forward slashes (look at gmail in basic html mode and you can easily see that). First of all, most of the special characters are entered as such. slashes must be entered as hyphens.

    so let’s say you have the following configuration:

Leave a Reply

Your email address will not be published. Required fields are marked *