Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was searching around but found no answers about this issue: I have a folder, in my Gmail account, where I automatically (with filters) put mail with attachments and other characteristics... they are basically emails that could be deleted.

I periodically delete all emails form such folder.

However, some of them, which have also additional labels, are useful to me and I don't want to delete.

Is there a way of deleting all emails from a folder except the ones which also belong to other folders?

Another way of considering the question: is there a way to delete all messages marked with a certain label only and not with other labels?

share|improve this question
up vote 1 down vote accepted

You won't be able to do it with a filter, because those act when the message comes in. However, it's simple to do with a search.

label:first -label:second

That search string will return all conversations with the label first and do not have the label second. The minus sign (- or hyphen, if you prefer) means negation.

More information about search operators is available at Advanced search.

If you want to exclude more labels, simply add them to your search string:

label:first -label:second -label:third
share|improve this answer
Many thanks, it partially fix the problem but it can work. The more comprehensive solutions would be to find a way to exclude 'all other labels' without having to specify them all. In my case I have many labels and writing -label:second -label:third ...-thirteenth.. would be a bit annoyng – Daniele B Nov 27 '13 at 10:53
Yes, unfortunately that's just how it works right now. – Al E. Nov 27 '13 at 16:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.