This study examined the influences of growth mindset and math learning motivation on students’ online learning engagement. A sample of 1649 middle school students participated in the study. The findings suggested that cognitive presence and task-involved motivation played a driving role in students’ online learning engagement and that task-involved motivation indirectly affected their online learning engagement through teaching presence and cognitive presence. Self-concept of mathematics ability and ego-involved motivation also impacted engagement and three presences with different estimates. At the same time, growth mindset significantly affected teaching presence, cognitive presence, and online learning engagement. These findings imply that in the process of mathematics teaching, teachers should consciously facilitate students’ math learning motivation, especially task-involved motivation, to improve students’ learning engagement. In addition, teachers should encourage students to be positive about their ability, foster students’ teaching presence through abundant teaching interventions, and encourage students to think deeply about mathematical problems to develop students’ cognitive presence, ultimately improving students’ learning engagement. Future research should consider the impact of the relationship between motivation and students’ growth mindset.