Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Is there any way to search for questions that have a specific tag and only that lonely tag?

In other words, I'd like to be able to do something like the following to find questions that have a single tag and no other:

[mytag] tagcount:1

This would be very useful for tag cleanup situations to be able to do house-cleaning before nuking a tag.

share|improve this question
Turned into a feature request. – Shadow Wizard Jan 29 '14 at 8:38
up vote 2 down vote accepted

I took the query in this other answer and cleaned it up a bit, making it more generic:

Declare @Tags nvarchar(150)
Set @Tags='<##Tag##>'
Set @Tags = Lower(@Tags)

Select Top 5000 Id As [Post Link], CreationDate
From Posts
Where Title is not null And Tags=@Tags
Order By CreationDate Desc

SEDE query.

share|improve this answer
where title is not null? I hope you meant where posttypeid = 1 – rene Mar 31 at 10:40
@rene lol, as I said I just took existing query which worked, and just cleaned it up a bit. I'm pretty sure that if doing it from scratch, would have used the elegant way of checking the post type value. :) – Shadow Wizard Mar 31 at 11:49

This query might help...

It is specifically for Programmers but you can use it to search for questions with only a specific tag.

share|improve this answer
That's awesome, but the data explorer doesn't include beta sites! – Caleb Oct 1 '12 at 13:19
@Caleb Yeah and the information is generally not updated frequently, as this is not production data. It is really only useful if you were curious for analytical reasons. – maple_shaft Oct 1 '12 at 13:22
I'm trying to do tag cleanup, so it would be nice it was actually live data so I could see progress as I re-tag things. +1 for a tangentially helpful bit though. – Caleb Oct 1 '12 at 13:23
Also, welcome to Meta.SO! I feel honored to catch your first post ;) – Caleb Oct 1 '12 at 13:23
@Caleb Thanks for the welcome! Been lurking for a while, don't feel compelled to discuss things often. – maple_shaft Oct 1 '12 at 13:30
@Caleb it include beta sites now. Enjoy! – Shadow Wizard Jan 29 '14 at 8:38

Using the API, you can find all questions that have a certain tag, then filter out the ones that have more than one tag. Here is a demonstration that searches for questions tagged solely with on Bicycles:

var tag = "puncture";
var site = "bicycles";

var url = '';

var h3 = $('h3 span');

// Retrieve data
(function gather(cp, object) {
    if (typeof object === "undefined" || object.has_more) {
        $.getJSON(url, {
            site: site,
            tagged: tag,
            page: ++cp,
            key: "awn3X8U)9erzSfhBhqSF4A((",
            filter: "!BGS1(RNaQD-DYnwoUQeh2eZDaLm__P"
        }, function (data) {
            h3.html("(" + cp + " pages)")
            if (object) {
                data.items = data.items.concat(object.items);
            gather(cp, data);
    } else {

// Display data
function display(data) {
    var data = data.items;
    data = data.filter(function (v, i, A) {
        return v.tags.length == 1;
    $.each(data, function (i, v) {
        var li = $('<li/>');
        var a = $('<a/>').attr('href',;
    var heading = $('<h3/>').html('Total: ' + data.length);
share|improve this answer

You must log in to answer this question.

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