China’s agricultural sector faces significant challenges, including fragmented farming practices, limited farmer knowledge of sustainable production, and outdated pest control technologies. These issues result in improper fertilization, pesticide application, and disposal of agricultural inputs, contributing to agricultural non-point source pollution and hindering the transition to a green economy. Thus, promoting green production behavior among farmers is critical for achieving carbon peaking, carbon neutrality, and harmonious coexistence between humans and nature. However, the existing literature on this topic is still relatively scarce. This study aims to investigate the impact of farmers’ cognition on their green production behavior (GPB). Considering the role of policy, this study also examines the moderating effect of government regulation in this relationship. An analysis of 306 survey responses from tea farmers in Jingmai Mountain, Pu’er City, Yunnan Province, reveals that farmers’ cognition exerts a significant and positive impact on GPB. Social norms and personal norms serve as chain mediators in the relationship between farmers’ cognition and GPB. Moreover, government regulation moderates the influence of farmers’ cognition on social norms, further amplifying its impact on them. This study advances the theoretical understanding of farmers’ behavior and offers practical insights for fostering the sustainable development of the tea industry.