I was led to believe that -[tag] would do this, but it doesn't appear to.


3 Answers 3


Tag search functionality is... limited... and completely broken in many complex cases when using the NOT operator.

Your best bet is to keep the search as simple as possible. Most of what you need to know is covered in my bug report here.

To summarize, here are some common cases you might try when doing an advanced search:

  • [tag1] -[tag2] -- works! (it's all downhill from here, so hopefully this is sufficient)

  • -[tag1] -- disallowed because the result set would be too big

  • -[tag2] [tag1] -- disallowed

  • [tag1] -[tag2-~] -- broken -- expands as [tag1] and -[tag2-a] or [tag2-b] or [tag2-c] instead of [tag1] and -([tag2-a] or [tag2-b] or [tag2-c])

  • [tag2-~] -[tag1] -- broken -- expands as [tag2-a] or [tag2-b] or [tag2-c] or -[tag1] instead of ([tag2-a] or [tag2-b] or [tag2-c]) and -[tag1]

  • [tag1] -[tag2] other search terms -- appears to be broken -- looks like the NOT operator is simply ignored

I could swear I had a comment discussion with Jeff about the ~ operator leaking out those ORs, but it was so long ago that I doubt I can find it at this point. He saw what was wrong, but I guess it never got fixed.

Anyhow, with the wildcards, even the erroneous expansions don't seem to produce correct search results... so at this point, don't even bother trying that. Wildcard searches on their own or in combination with other ANDed tags work fine. It's only when the NOT operator is introduced that everything blows up... but that's what you asked for in this question, so there it is.

  • I did look at it -- the fix was kind of difficult. Apologies. Commented Oct 13, 2010 at 1:49
  • @Jeff: Okay, as long as you looked at it. Obviously it's not a high-priority bug, but it would be nice to get it fixed. I think the most important one out of the ones I've listed above would be the tags + free text searching with a NOT.
    – Jon Seigel
    Commented Oct 13, 2010 at 16:39

You can, but a query cannot have merely a not clause.


is disallowed, but


is allowed

  • 1
    So is there something wrong with stackoverflow.com/… , because that doesn't seem to work.
    – Bobby Jack
    Commented Aug 13, 2010 at 8:42
  • Anyone know what's wrong with the example in my previous comment?
    – Bobby Jack
    Commented Sep 29, 2010 at 12:57
  • @Bobby - Looks like you can only do tags without a search term if you do a not search. ----------- The not search would seem like something that should be in [ the search FAQ ](stackoverflow.com/search). Commented Oct 13, 2010 at 0:38

You can only do this with tags alone using questions/tagged. You can use the form -tag, in conjunction with another tag: questions/tagged/this+-that

The not functionality will not work in a search, so there's no way to add a search term.

So this will work:


The above selects all [javascript] that are not [html].

If you try and add a search term it will only look like you're selecting questions that are not in a tag.

For example to try and search "open link new window" in [javascript] but not [html], you can try the following.

This will not work.


This will take you to a page that says not HTML, but that's not true:

alt text (click to enlarge)

You can try Google with something like:

open link new window +javascript -html site:stackoverflow.com

  • 1
    It works if you just search by tags (IE without the "open link in new window").
    – Gelatin
    Commented Oct 13, 2010 at 0:32
  • @Simon - Thanks. Didn't know that. Nice feature. - Though it's not really a search, since it just redirects to questions/tagged. Commented Oct 13, 2010 at 0:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .