We report a cationic porphyrin 5,10,15,20‐tetrakis‐(4‐N‐methylpyridyl)‐porphyrin (TMPyP) that can respond to specific bacteria, followed by adaptable photodynamic/photothermal therapy processes. TMPyP could be reduced to phlorin by facultative anaerobes with a strong reducing ability such as E. coli and S. typhimurium in hypoxic environments, possessing strong NIR absorption and remarkable photothermal conversion capacity, thus demonstrating excellent antimicrobial activity (>99 %) by photothermal therapy. While in an aerobic environment with aerobic bacteria, TMPyP functioned as a typical photosensitizer that killed bacteria effectively (>99.9 %) by photodynamic therapy. By forming a host–guest complex with cucurbit[7]uril, the biocompatibility of TMPyP significantly improved. This kind of bacteria‐responsive porphyrin shows specificity and adaptivity in antimicrobial treatment and holds potential in non‐invasive treatments of bacterial infections.