Although photodynamic therapy (PDT) has great potential for treating severely infected wounds, it is restricted by the short lifetime, limited diffusion distance of reactive oxygen species (ROS), and incomplete contact with bacteria. Herein, we report a novel nanosized ionic porous organic polymer (TPAPy-IPOP) based on the triphenylamine (TPA) moiety. Strong electron-deficient cationic groups were introduced into TPA to construct the donor–acceptor (D–A) system, in which the photoelectric effect of TPAPy-IPOP was greatly enhanced, and it was easily excited to produce ROS under irradiation with visible light. The introduction of cations not only facilitated bacterial adsorption by TPAPy-IPOP via electrostatic attraction, which was more conducive to killing bacteria by ROS, but also inactivated bacteria by the cations directly. The nanosized TPAPy-IPOP remained suspended in water for several months and could be sprayed onto various substrates to form a durable coating with excellent antibacterial properties. The in vivo results proved that the silk fibroin/polyvinyl alcohol non-woven fabric (SF/PVA) coated with TPAPy-IPOP could create and maintain a sterile microenvironment at a wound site. The rapid reduction in inflammation resulting from its bactericidal action accelerated the wound healing rate. Collectively, this design is expected to offer a generalizable approach for developing novel antibacterial therapeutic photosensitizers, especially for infected wound treatment.