Traditional wound care methods are less effective for infectious and diabetic wounds, highlighting an urgent need for effective strategies. The study aimed to design a self-healing hydrogel with antibacterial, antioxidant, and photothermal capabilities to treat infectious and diabetic wounds. Silver nanoparticles (AgNPs) were loaded into mesoporous polydopamine (MPDA) nanoparticles to form Ag@MPDA nanoparticles. Ag@MPDA was incorporated into the cationic guar gum-chitosan-boric acid (CCB) hydrogel to obtain the PA-CCB hydrogel. PA-CCB hydrogel exhibited excellent self-healing and adhesive properties, adapting well to the dynamic wound environment. PA-CCB hydrogel combined with photothermal therapy (PTT) could effectively eradicated E. coli (99.9 %) and S. aureus (99.7 %). The PA-CCB hydrogel reduced excessive reactive oxygen species and promoted the migration of fibroblasts in vitro. In the infected mouse wound models, the PA-CCB hydrogel effectively inhibited bacteria. After combining with PTT, the antibacterial ability of the PA-CCB hydrogel was further enhanced. In the diabetic mouse wound models, the PA-CCB hydrogel reduced the inflammatory level of wound tissue. In both models, after combining with PTT, the PA-CCB hydrogel exhibited further improvements in angiogenesis, collagen deposition, and re-epithelialization. By integrating multifunctional hydrogel with PTT, the PA-CCB hydrogel exhibited broad application potential for infectious and diabetic wounds.