A nationwide effort to use legislation to enforce helmet-wearing behavior for electric bicycle (e-bikes) riders had varying effects in different Chinese provinces. This study examines the determinants of e-bike riders’ switching behavior with regard to helmet wearing. The theoretical framework is based on the push-pull-mooring model, incorporating variables such as perceived legal norms and conformity tendencies. Partial least squares structural equation modeling (PLS-SEM) is employed to analyze the data collected from 322 participants in Zhenjiang. A multi-group analysis (MGA) was conducted to understand the effect of experiencing punishment among e-bike riders. The results highlight that push, pull, and mooring effects significantly influence switching intentions. Furthermore, the MGA results reveal that the experience of punishment has a moderating effect in the relationship between pull effects and switching intention. This suggests personalized enforcement strategies could be more effective in promoting helmet wearing. The findings could help to develop strategies for traffic authorities to promote helmet usage and thus increase rates of helmet wearing.