BackgroundNutrition education is a key component of health promotion programs which leads to the improvement of students’ nutritional behaviors. The transtheoretical model (TTM) is one of the models extensively used in changing people’s behaviors. This study aimed to change the dairy consumption behavior based on the TTM in female students.MethodsA controlled trial was conducted with 159 female students (intervention group: 56; control group: 103) in the 10-11th grades from two public schools in Soumesara city located in the west of Gilan Province, Iran. Demographic characteristics, knowledge, TTM constructs and stage of change of dairy consumption were collected using a valid and reliable researcher-made questionnaire. Data were gathered before and one month after the educational intervention. Chi-square test, t-test and ANCOVA were used to analyze the data and a p-value < 0.05 was considered statistically significant.ResultsFifty-two students from the intervention and 93 from the control group completed the study. Only 15% of the students were in the action or maintenance stages of dairy consumption. After the intervention, mean scores of behavioral processes of change, cognitive processes of change, decisional balance, and self-efficacy improved in the intervention group (P < 0.05 for all). Also, 37% and 16% of the participants in the intervention and control groups, respectively, were in the action or maintenance phase (P < 0.001).ConclusionsThis study showed that implementing an intervention based on the TTM would positively affect students’ dairy consumption behaviors. Also, it is suggested that the TTM be assessed in terms of other daily nutritional needs in students to promote their nutritional behaviors.Trial RegistrationThe study was registered in the Iranian Registry of Clinical Trials (IRCT) (available online athttps://en.irct.ir/trial/50003) on April 11, 2020 with the number IRCT20200718048132N1 and was approved by research ethics committee of Guilan University of Medical Sciences, Iran.Supplementary InformationThe online version contains supplementary material available at 10.1186/s40795-023-00736-7.