The impacts of COVID-19 reach far beyond the hundreds of thousands of lives lost to the disease; in particular, the pre-existing learning crisis is expected to be magnified during school shutdown. Despite efforts to put distance learning strategies in place, the threat of student dropouts, especially among adolescents, looms as a major concern. Are interventions to motivate adolescents to stay in school effective amidst the pandemic? Here we show that, in Brazil, nudges via text messages to high-school students, to motivate them to stay engaged with school activities, substantially reduced dropouts during school shutdown, and greatly increased their motivation to go back to school when classes resume. While such nudges had been shown to decrease dropouts during normal times, it is surprising that those impacts replicate in the absence of regular classes because their effects are typically mediated by teachers (whose effort in the classroom changes in response to the nudges). Results show that insights from the science of adolescent psychology can be leveraged to shift developmental trajectories at a critical juncture. They also qualify those insights: effects increase with exposure and gradually fade out once communication stops, providing novel evidence that motivational interventions work by redirecting adolescents' attention.