When I type nothing but tags in the search box, I'm redirected to the coresponding tag page.

Search Box       URL
css              /questions/tagged/css
css jquery       /questions/tagged/css+jquery

I would like to see it also work the other way around. When I visit a tag page I would like to see the search box populated with the corresponding tags.

URL                           Search Box
/questions/tagged/css         [css]            
/questions/tagged/css+jquery  [css] [jquery]        

It's a feature in the sense that when users visit a tag page, it would show them how to search within those tags.

It's a bug in sense that when users search with keywords that all happen to be tags, their input is not retained on the "search results" page.


4 Answers 4


This will go out in the build tonight, on tag pages you'll see the [tag] or combination or tags in the search box for easy searching of that content. For example, this: https://stackoverflow.com/unanswered/tagged/jquery%20-javascript%20html

Will now have this in the searchbox: [jquery] -[javascript] [html]

A simpler example: https://stackoverflow.com/questions/tagged/java

Will now have: [java]

This applies to /questions/tagged/ and /unanswered/tagged/ for the moment, if it makes sense elsewhere we'll look at adding it there too.


Adding the "[tag]" text to the search box when clicking on a tag or visiting the tag page would make it easier to refine the search with additional keywords. Right now the search box simply contains "search" and you have to retype the [tag] and keywords if you want to refine the search. This should work more like Gmail where clicking on a label adds "label:oqa" to the search box. This helps novice users learn how to search for labeled emails and makes it much easier to modify or refine the search.

The search box works as desired if you search for something like "[tag] keyword", but searching for only tags such as "[fun] [discussion]" redirects to the /questions/tagged/fun+tags url mentioned above.

I guess this could be a feature implemented via a custom userscript if someone wanted to implement it...


This should be a pretty low-hanging fruit. Here's a client-side solution.

var tags = location.pathname.split('/').pop().split('+');
var keywords = $.map(tags, function(t) { return '[' + t + ']' }).join(' '); 
  • 2
    +1. Even though I don't like the idea, I love answers that provide the solution in code :-) May 17, 2010 at 21:23

Seeing how this was upvoted at least 8 times I'll probably get downvoted to hell for saying so but I think that Autocomple tags in the search box is a much better solution to showing users how to search for tags. It's also a benefit to long time users who can't remember the proper tag, for example, does the tag have a hyphen or not.


You must log in to answer this question.

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