Law enforcement is intended to deter illicit behaviors by instilling fear in people. However, limited empirical evidence exists regarding the effect of law enforcement on people's perceived risk of being sanctioned for violating rules and regulations. Here, we explore the general deterrent effects of recycling law enforcement using a survey experiment with 744 residents of Shanghai, China. Information on recycling law enforcement increases respondents' perceived intensity of monitoring and perceived risk of punishment for violations of recycling laws. The effects still hold when excluding the confounding effects from the enactment of recycling laws. We also investigated heterogeneity of the effects across populations. Our results underscore the existence of general deterrent effects associated with recycling law enforcement. We conclude that the public disclosure of cases of punishment for recycling law violations could serve as an effective means to enforce recycling practices.