AbstractPeach bacterial shot hole is a common global disease of peach trees caused by the pathogen Xanthomonas arboricola pv. pruni (Xap). To preliminarily explore the resistance mechanism of peach bacterial shot hole, leaves of the resistant variety ‘Yanbao’ and the susceptible variety ‘Frederic’ were used as test materials. The contents of total phenols, total flavonoids and lignin were analysed after 1 day of inoculation treatment, and the activities of defence enzymes and cell wall degradation enzymes in the leaves were determined. Furthermore, the resistant substances were screened by combining broad‐target metabolomics technology and in vitro antibacterial activity. The results showed that the contents of total phenols, total flavonoids and lignin in peach leaves were related to resistance. The resistant varieties resisted infection by inhibiting the activities of polygalacturonase (PG) and pectin methyl trans‐eliminase (PMTE) produced by Xap in peach leaves and increasing the activities of 4‐coumarate:coenzyme A ligase (4CL), cinnamic acid‐4‐hydroxylase (C4H), phenylalanine ammonia lyase (PAL) and peroxidase (POD). A total of six resistant compounds were screened from 85 differential metabolites. The minimum inhibitory concentrations of methyl ferulate (MF), p‐coumaric acid (p‐CA) and methyl caffeate (MC) on Xap were 0.0625, 00625 and 0.125 mg/mL, respectively, while that of the positive control drug oxytetracycline (OTC) was 0.125 mg/mL. The antibacterial activities of MF and p‐CA were better than that of OTC, and MF was equivalent to OTC. In addition, homoeriodictyol, hesperetin and fraxin have certain antibacterial effects. Before inoculation treatment, the contents of MF, p‐CA and MC in ‘Yanbao’ were 1.13, 1.24 and 1.96 times higher than those in ‘Frederic’, respectively, while they were 1.29, 1.80 and 1.94 times after inoculation treatment, respectively. During the process of pathogen infection, MF and p‐CA in the leaves of resistant peach varieties played a role in inducing resistance, while MC was a component of resistance. The above three cinnamic acid derivatives play an important roles in the resistance of peach bacterial shot hole and are potential control drugs.