Suppressing persistent multidrug-resistant (MDR) bacterial infections and excessive inflammation is the key for treating chronic wounds. Therefore, developing a microenvironment-responsive material with good biodegradability, drug-loading, anti-infection, and anti-inflammatory properties is desired to boost the chronic wounds healing process; however, using ordinary assembly remains a defect. Herein, we propose a pH/enzyme dual-responsive polymyxin B (PMB) spatiotemporal-release hydrogel (GelMA/OSSA/PMB), namely, the amount of OSSA and PMB released from GelMA/OSSA/PMB was closely related the wound pH and the enzyme concentration changing. The GelMA/OSSA/PMB showed better biosafety than equivalent free PMB, owing to the controlled release of PMB, which helped kill planktonic bacteria and inhibit biofilm activity in vitro. In addition, the GelMA/OSSA/PMB exhibited excellent antibacterial and anti-inflammatory properties. A MDRPseudomonas aeruginosacaused infection was effectively resolved by the GelMA/OSSA/PMB hydrogel in vivo, thereby significantly boosting wound closure during the inflammatory phase. Furthermore, GelMA/OSSA/PMB accelerated the sequential phases of wound repair.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12951-023-01947-7.