A simple and efficient method involving microwave‐assisted extraction (MAE) combined with GC–MS was established to determine 1,3‐di‐tert‐butylbenzene (DBB), 2,4‐di‐tert‐butylphenol (DBP), 3,5‐di‐tert‐butyl‐4‐hydroxybenzaldehyde (DBHBA) for evaluating the compatibility of antimicrobial peptide PL‐5 spray with drug‐packaging materials. In this study, the antimicrobial peptide PL‐5 spray was purified using a Welchrom C18 column, and the high‐density polyethylene spray bottle with liquid collection tube was first mixed with absolute ethanol, which would be subjected to MAE for further measurement by GC–MS. Various experimental parameters were systematically optimized, and good linearities were obtained within the range of 0.05–1.00 μg/mL for DBB and DBHBA and 0.50–10.00 μg/mL for DBP, with limits of detection (LODs) of 0.99 ng/mL (DBB), 16.34 ng/mL (DBP), and 1.64 ng/mL (DBHBA). Satisfactory recoveries that ranged from 96.0% to 107.2% were acquired, and the relative standard deviation was ≤ 4.7%. The results showed that the maximum daily usage of DBB, DBP, and DBHBA was 9.859, 163.445, and 16.399 ng, respectively, which was far below the corresponding permitted daily exposure values according to the safety assessment, indicating that the migration of analytes did not bring any potential safety risk. The compatibility between the drug and the packaging materials was favorable.