Introduction: Enhancing the green total factor productivity of dairy cows (GPDC) is crucial for fostering the low-carbon sustainable development of the dairy industry.Methods: This research utilizes the Minimum distance to weak efficient frontier–Meta frontier–Malmquist–Luenberger (MinDW-MML) index to examine the GPDC using the unbalanced panel data on dairy cows in 26 provinces of China from 2004 to 2020, taking into account regional heterogeneity and unexpected output.Results: The findings revealed that 1) from 2004 to 2020, China’s GPDC displayed a fluctuating and declining trend, with the steepest decrease occurring from 2007 to 2010 (2.26% at the common frontier and 1.81% at the group frontier). The fundamental cause of the low GPDC, as seen from the standpoint of efficiency decomposition, is technical advancement (technological change, or TC); 2) the GPDC exhibits a declining trend from east to west to central China for the two-level frontier. The eastern region benefits clearly from technological advancement (TC) and improved technical performance (EC), while the middle and western regions are mostly constrained by TC; and 3) the GPDC displayed regional heterogeneity at several scales. Although the efficiency values of medium- and small-scale aquaculture were low and large-scale aquaculture GPDC in the eastern and western regions was greater than 1, the GPDC did not reach the effective state in the central region.Discussion: Based on these findings, we propose policy recommendations such as promoting technological innovation and low-carbon technology in dairy farming, improving the technical system of dairy farming, and optimizing the industrial layout of dairy farming, which will serve as a model for future high-quality and sustainable dairy farming development in China, and provide an experience for green dairy farming development in other countries.