Biofilm‐infected diabetic wounds (BIDWs) with hyperglycemia and bacterial colonization are characterized by disordered inflammation and abnormal activation of NLRP3 inflammasome, leading to sustained macrophage M1 polarization and neutrophil extracellular traps (NETs) formation. An immoderate anti‐inflammatory treatment that downregulates NLRP3 in turn promotes the persistence of biofilm infections and impairs the healing of BIDWs. Therefore, reconciling biofilm elimination and immune regulation holds the promise of curing BIDWs. Herein, a novel spatiotemporal on–off immunomodulatory therapy (SOIT) is proposed for treating BIDWs through biphasic regulation of NLRP3. Methacrylate gelatin hydrogels (Gel‐MA) incorporated with graphene oxide (GO) and metformin‐loaded mesoporous silicone nanospheres are synthesized and photo cross‐linked to construct a nanocomposite hydrogel (MGO@GM). First, GO nanosheets released from MGO@GM inhibit bacterial biofilm formation and disrupt mature biofilms under near‐infrared irradiation. Meanwhile, GO activates the NLRP3 to induce a macrophage‐associated proinflammatory response against biofilms. Afterward, with the subsequent degradation of MGO@GM, released metformin reduces local hyperglycemia, downregulates NLRP3, and inhibits NETs formation. Furthermore, repolarized M2 macrophages alleviate the inflammatory microenvironment and promote tissue regeneration. Briefly, this SOIT strategy regulates the NLRP3 and rescues impaired innate immunity to facilitate anti‐infection and tissue repair, which provides a new perspective for the future clinical treatment of BIDWs.