MOSCOW — Be careful what you write online in Russia: A judge might not wash your mouth out with soap, but a fine is now a possibility.

A Russian court this week for the first time applied a law forbidding the use of obscenities to describe public officials, state symbols or government bodies. It fined an unemployed carpenter in a small town, apparently singled out at random from the sea of foul language users on the Russian internet, for calling President Vladimir V. Putin a vulgar form of the Russian word for dimwit.

Though this law might seem ineffective, given the scale of vulgar language used in a political context on social media in Russia, as elsewhere, it reflects a serious effort by Russia and other authoritarian states to find ways to censor crowdsourced news and commentary in the digital era, when the Soviet practice of putting a censor in a newspaper’s newsroom can no longer suffice.

Some old methods persist, like the wall-to-wall praise broadcast on state media for Mr. Putin. But Russia, unlike China, has mostly allowed free access to Western and Russian social networking sites, offering a space for political discourse, sometimes expressed in foul language.