Possible Duplicate:
What should I do if a user posts sensitive information as part of a question or answer?

Every once in a while, when I am posting code to either ask or answer a question, I find myself cleaning out all the references to the company I'm working for and scanning for any other proprietary or confidential info. I figure that if I'm doing it others are doing it, and that means that occasionally, there are going to be pieces of code that we miss:

using System;

namespace HotOrNotDotCom
    public class Login
        int timesBeforeLockout = 4;
        public Login(string username, string password)


What's the right thing to do in this circumstance? If we come across something like this, should we edit the info out? Has SO ever gotten a takedown request? Has a user ever suffered as a result of posting code he or she has written as part of their work?

  • @casperOne Isn't the other question a duplicate of this one instead of this question being a duplicate of that one? Because this is older? Commented Oct 23, 2012 at 9:58
  • 1
    @AnishGupta Age doesn't always indicate priority when closing duplicates. That question is the better question, and the accepted answer better represents current thinking and guidance for this subject matter.
    – casperOne
    Commented Oct 23, 2012 at 11:27

2 Answers 2


Even if you do edit it out, it will still be in the revision history, so it is not advisable.

Flag the post for moderator attention and recommend they delete the revision entirely.


It seems like a combination of these would be best.

What I would suggest is:

  • If you can, edit the code to remove the offending information.
    • This won't remove it from the revision history, but will hide the information in the revision history, minimising exposure to the problem.
  • If you don't have edit privileges, flag the post for moderator attention.
    • A moderator will then know to edit out the offending information for you.
  • Even if you can edit the question/answer, flag it for moderator attention.

Note, even if you don't have edit privileges, you could submit the change to the peer review queue. Unfortunately this does draw attention to the problem in a rather more public way (i.e. everyone with edit privileges), so it might be better to just flag for the moderators attention.

  • For something like this, I don't think you could be overly loud. If there is information in the revision history that, from a legal standpoint, shouldn't be there, be as noise as you can (short of calling someone on their home phone at 4AM or, depending on what hours they keep, 10AM).
    – BCS
    Commented Jun 28, 2010 at 17:12
  • @BCS - The trick is being loud to people who can do something about it (stack exchange developers and community managers can delete revisions) while being quiet with everyone else.
    – Mark Booth
    Commented Oct 23, 2012 at 8:45
  • 1
    Keep in mind, this is rarely done, and nearly always done as a courtesy to folks who've posted something they regret (or should regret). I've routinely refused requests that smell like attempts to censor information someone else finds... Inconvenient.
    – Shog9
    Commented Oct 23, 2012 at 18:55

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