Persistent bacterial infections and excessive oxidative stress prevent the healing of diabetic ulcers, leading to an increased disability rate. Current treatments fail to kill bacteria while simultaneously relieving oxidative stress. Herein, a dynamic microenvironment-adaptable hydrogel (BP@CAu) with photothermal performance and reactive oxygen species scavenging is presented for diabetic ulcer healing. This hydrogel prepared using a dynamic borate-ester could respond to acidity in the infection microenvironment for a controllable drug release. An excellent photothermal conversion effect was integrated in the hydrogel, which exhibited strong antibacterial activity against Staphylococcus aureus and Pseudomonas aeruginosa. The hydrogel attenuated intracellular oxidative stress and inflammation and promoted cell migration. In a full-thickness skin defect model of diabetic rats, the BP@CAu hydrogel contributed to the fastest wound closure, with ideal reepithelialization, granulation tissue formation, and regeneration of blood vessels. Further mechanistic studies revealed that the hydrogel relieved oxidative stress and downregulated the expression of inflammatory cytokines, resulting in dramatic therapeutic effects on diabetic wounds. Therefore, this study provides a synergistic therapeutic strategy for efficient photothermal performance and reactive oxygen species scavenging in diabetic ulcers.