52

Please add a search operator that selects for (or against) the protected status flag.

5
  • Yep, gotta have it. Jun 7, 2010 at 15:25
  • 2
    Can you provide a use case? I can only think of why a spammer would want to search on that criteria, so my mind must not be right. Jun 7, 2010 at 15:40
  • I tried it because I wanted to see what was ending up that way---I guess the data dump would do for that eventually. The only other legitimate use case I can think of is a user under the threshold search for questions to answer; but with the threshold lower than for voting (!) perhaps we can neglect that one. Jun 7, 2010 at 15:45
  • I don't think very many questions will end up protected (at least the way it's structured now). New users looking for questions to answer are more likely to read recent/new questions than use advanced search features. But I can maybe see it would be useful for the community (i.e. higher-rep or mods) to filter out protected questions.
    – Gnome
    Jun 7, 2010 at 15:54
  • This feature request was made over 10 years ago. What is the status? Sep 16, 2020 at 8:11

4 Answers 4

21

I agree that there should be a way to search for these, especially as an absent-minded moderator.

One can search for Locked questions with locked:1, perhaps added since Gnome's comment in 2010. One can also search for closed questions with closed:1, deleted posts with deleted:1 (moderators only at this time), and as noted by Shadow Wizard hasnotice:1 to find questions with active bounties, or locked for historical value.

It seems like an oversight that protected:1 does not work the same way.

5
  • Are you sure deleted:1 works? I don't think so.
    – Himanshu
    Sep 2, 2013 at 7:52
  • 3
    @hims056 most likely only for mods. Sep 2, 2013 at 7:55
  • @hims056 perhaps it is a moderator-only field; it definately works on Mathematica where I am one.
    – Mr.Wizard
    Sep 2, 2013 at 7:56
  • 3
    Don't forget the "hasnotice:1" operator, used to find questions with active bounties, or locked for historical value. :) Sep 2, 2013 at 7:59
  • @ShaWizDowArd I was not aware of that one. Thanks for the reminder.
    – Mr.Wizard
    Sep 2, 2013 at 8:00
7

Since users can protect questions once they have enough rep for the privilege, this is doubly important for moderators and users to be able to search for.

I'm currently trying to investigate a potential misuse of protection privileges and being able to search with protected:true would be very useful. I suspect I would have to resort to the Data Explorer, though it's overkill for this case and that higher barrier (compared to search) may mean I won't find the time for it. A search token for it would be very useful.

6

I'm not sure that it existed when this question was asked, but the 10K moderation tools page includes a link to a list of all protected questions. The one for Meta Stack Exchange is here, the link extension being tools/protected-questions.

This is available to all moderators on their sites and to any users who have access to those tools (10k on sites the higher reputation levels and 4k on sites with lower ones).

While this page is quite useful, it's not searchable, only sortable(-ish). There's no way to restrict which questions show up there other than by date so, as in SevenSidedDie's example, you would have to sort by user and then find their name in the alphabetical list. If this search function were added, a specific user could be included in the search to find all posts protected by that user - or by Community. To make things worse, the sorting only affects the content of the current page, not the entire list, making it nearly useless.

Here on MSE, there are only 137 of them, which isn't bad with 50 results per page, but on sites that use this feature regularly, there are lots (e.g. 727 on M&TV, 659 on The Workplace).

1
  • Excellent suggestion, although this would only be useful for 10k+ users (but again, probably only those users will be interested in protected questions).
    – DarkCygnus
    May 4, 2018 at 23:38
3

You can use the following SEDE Query to produce a list of question that are currently protected:

select p.id as [Post Link]
     , p.creationdate [created on]
     , case when ph.userid is null then
         ph.userdisplayname
       else
        concat('site://q/',ph.userid,'|', u.displayname)
       end as [protected by]
     , ph.creationdate [protected on]
from posts p
inner join posthistory ph on ph.postid = p.id
left outer join users u on u.id = ph.userid
where ph.posthistorytypeid = 19  -- protected
-- make sure no unprotect took place later
and not exists (select * 
                from posthistory 
                where posthistorytypeid = 20 -- unprotect
                and postid = p.id
                and id > ph.id)

When run today this will what your result might look like for Stack Overflow:

list of protected questions

Keep in mind SEDE is only updated once a week, on Sunday. If you're new to SEDE give the tutorial a try or join chat

2
  • Can I search by keyword for protected questions? Feb 12, 2019 at 17:52
  • @SonictheIntrovertedHedgehog not in this version but the posts table is linked so you add a and p.body like '%keyword%' at the end to achieve that. Use and p.body like '%##keyword##%' for awesomeness ...
    – rene
    Feb 12, 2019 at 17:56

You must log in to answer this question.

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