Infected wounds cause severe medical complications and even chronic mortality, leading to persistent health burdens. Therefore, the enhancement of wound healing has been a major goal of medical researchers. Herein, a photoactive self-healing hydrogel (termed as Macropatch), composed of carboxymethyl chitosan (CMCS), tannic acid (TA) and graphitic carbon nitride g-C3N4 (GCN), was developed to promote wound healing through simultaneously modulating pathological related factors. We identified that dynamic hydrogen bond, hydrophobic interaction and crosslinking between hydrogel backbones endowed Macropatch with good self-healing capability and mechanical property, allowing for protecting the wound from further injury. In addition, Macropatch exhibited superior tissue adhesiveness and cell affinity due to numerous catechol groups of TA chains, and enabled tight wound adhesion to seal organ bleeding. Specifically, GCN endowed Macropatch with improving mechanical strength, self-healing ability and especially visible light-induced antibacterial activity, leading to a fast recovery of bacteria-infected wounds. More remarkably, benefiting from inherent and photodynamic antibacterial properties, Macropatch could prevent bacterial infections under visible light irradiation, and consequently increase the collagen synthesis and re-epithelization, accelerating bacteria-infected wound healing process. Overall, photoactive Macropatch is a safe wound dressing with the potential of overcoming challenges in infectious wound healing, and might be applied in clinical condition.