Building digital government is an important means for the government to improve the public service ability and optimize the business environment, which directly affects the production and operation activities of micro-enterprises. Based on the panel data of listed enterprises and municipal government portal website performance in China, this paper empirically investigates the impact of digital government development on enterprise total factor productivity (TFP) and the moderating effect of the local government’s attention distribution. The research results showed that digital government development significantly improved the enterprise TFP, and this conclusion remained unchanged after a series of robustness tests using instrumental variables, one-stage lag of explained variables, and debiased machine learning models. We also found that the greater the pressure faced by local governments and the longer the chief officials’ tenure, the more attention local governments paid to building digital government, and the more obvious the role of digital government development in promoting enterprise TFP. Heterogeneity test results showed that the information disclosure, online service, and public participation all had a positive effect on enterprise TFP, while the user experience had no effect on it. Digital government development had a more obvious role in promoting enterprise TFP of central and western regions, non-SOEs, and technology-intensive enterprises. Moreover, reducing enterprise rent-seeking, attracting new enterprise entry, and increasing enterprise R&D investment are important mechanisms for digital government development to improve enterprise TFP.