The cow stock of smallholder farmers with less than 100 cows still accounted for nearly 50% of total cows in China. Since the milk scandal occurred in 2008, raw milk safety has become focus for the sound development of the Chinese dairy industry. Adoption of on-farm milk safety measures by smallholders is a key for ensuring milk safety, and these measures are largely voluntary in nature. The recent survey conducted in northern China reveals that an overall adoption rate of various milk safety measures by smallholders is close to 48% with wide variations across the dairy farmers. We employ the Poisson regression model to study the determinants of farmers' adoption of voluntary milk safety measures. Compared with backyard dairy farmers, dairy complex and scaled dairy farms adopted more milk safety measures. Moreover, the empirical result indicates that farmers' adoption of raw milk safety measures is positively affected by farm size. These findings suggest that the changing dairy production structure towards larger farms and away from backyard dairy farming prompts smallholder dairy farmers to adopt more raw milk safety measures. This lends some support to the role of recent policy initiatives towards larger farms and away from backyard dairy farming on increasing the farmers' milk safety practices and reducing on-farm incidence of milk safety.