Traditionally, Jewish communities have used social pressure in dealing with the publicly observant whose private behavior includes blatant violation of basic halachah.
If all else fails, it is permissible to publicize the fact that an otherwise observant Jew is guilty of immorality on a regular basis, if the disclosure will prompt him to repent.
Similarly, rabbinical courts have the authority to post signs informing the public of someone’s refusal (siruv) to comply with a court ruling. Social pressure is often the only means through which rabbinical courts can enforce their decisions.
Sefer Chofetz Chaim, 26 Cheshvan, page 160
es