Abstract Excessive production of reactive oxygen species such as H 2 O 2 is the pathological basis of chronic inflammatory diseases, as well as bacterial infection‐induced inflammation. Therefore, the in situ H 2 O 2 level is a reliable biomarker of inflammatory responses, and its real‐time measurement can monitor disease progression and improve therapeutic outcomes in inflammation‐linked diseases. However, the currently used strategies for the diagnosis of inflammation is mainly through routine blood test, which are limited in determining the inflammation status and cannot provide comprehensive quantitative information. In this work, a novel H 2 O 2 ‐responsive theranostic nanoplatform comprising Ag shell coated Pd‐tipped gold nanorods (Au–Pd@Ag NR) is developed. The etching and oxidation of the Ag shell by H 2 O 2 release the Ag ions, which effectively kill bacteria in vivo and trigger their absorption variation at 700 and 1260 nm. The ratiometric photoacoustic (PA) imaging at 1260 and 700 nm (PA 1260 /PA 700 ) accurately quantifies H 2 O 2 in a mice model of bacterial infection and abdomen inflammation, even in a rabbit model of osteoarthritis. The H 2 O 2 activated second near‐infrared (NIR‐II) PA images of the probe can further precisely differentiate the inflammation region and normal tissue. This nanoplatform not only can quantify H 2 O 2 during inflammation but also act as a potent antibacterial agent.