First, "shooting oneself in the foot" doesn't necessarily imply that you were trying to remedy a bad situation, only that your actions have caused yourself misfortune in some way. Generally, there are many words which indicate different degrees of mistake or error, like gaffe, fumble, and botch.
However, the examples you cite both sound more like the Streisand effect, in which attempting to suppress or censor something ironically results in an increase in its general popularity.