In the era of the digital economy (DE), the traditional economic growth paradigm is no longer applicable. To explore whether the DE can improve the urban ecological problems left behind by rough economic growth, this study examines the effects of land resource mismatch (LRM) on urban ecological resilience (UER) and evaluates the mitigating influence of the DE. This analysis utilizes data from 280 prefectural-level cities in China over the period from 2007 to 2021 and reveals that LRM significantly undermines UER, with this conclusion remaining robust across a series of tests. Additionally, the detrimental impact of LRM on UER is more pronounced in megacities, cities with high levels of economic development, and those with a lower degree of advanced industrial structure. In further analysis, this study finds that the digital economy can optimize the allocation of land resources, thereby enhancing urban ecological resilience, which has the effect of “treating the root causes”. In addition, digital government and digital infrastructure, as key elements of the digital economy, also mitigate the negative impacts of land resource misallocation on urban ecological resilience, having the effect of “treating the symptoms”. Finally, this study proposes policy suggestions such as optimizing ecological layout, deepening land reform, and promoting digital government and infrastructure construction to provide a theoretical basis and practical guidance for local governments to enhance UER and help build a new model of greener, more resilient, and sustainable urban development.