The development of online learning depends on the development and progress of the Internet technology. Meanwhile, metaverse is considered to be a new generation of the Internet that will drive a new iteration of the Internet era. Integrating the metaverse concept into online learning will surely bring a profound revolution to the latter. In 2020, with the outbreak of the epidemic, online learning has become an important learning method for the majority of students studying in universities. However, the effectiveness of online learning is highly concerned and questioned. This study elaborates the connotation and spatial characteristics of metaverse technology, relies on its features and advantages, makes a specific analysis of the inner logic of metaverse integration into online learning, and creates an embodied learning context, immersive learning context, and interactive learning context for online learning according to the current situation of students' online learning, and proposes metaverse online learning context optimization strategies in terms of both classroom teaching optimization and policy optimization, with a view to improving students' online learning effectiveness.