Mycoplasma hyopneumoniae (M. hyopneumoniae), the etiological agent of porcine enzootic pneumonia, is one of the most prevalent and economically significant respiratory pathogens in the swine industry. Vaccination constitutes a primary strategy for controlling M. hyopneumoniae infections. Live-attenuated vaccines confer protection against wild-type M. hyopneumoniae through competitive exclusion of early lung colonization and induce multifaceted immune responses, including humoral, mucosal, and cellular immunity, thereby exhibiting superior protective efficacy. However, the lack of methods for differentiating live-attenuated vaccine immunization from wild-type infection has hindered the widespread application of live-attenuated vaccines. In this study, we developed a quantitative real-time polymerase chain reaction (qPCR) method based on the ribonuclease H2 (RNase H2) cleavage principle, which emits specific fluorescent signals exclusively when the probe is fully complementary to the template of the live-attenuated vaccine strains. This qPCR method exhibited high specificity and sensitivity for the M. hyopneumoniae live-attenuated vaccines (168-L and RM48), with a lower detection limit of 10 copies/µL. Using this qPCR method, the bacterial shedding dynamics of the 168-L vaccine strain in piglets were effectively monitored, with the first detection in the nasal cavity at 3 days postvaccination (dpv), and a peak detection rate of 100% between 10 and 17 dpv. This established assay can specifically monitor the respiratory colonization and shedding of the vaccine strain after M. hyopneumoniae live-attenuated vaccine immunization, thereby providing crucial technical support for the clinical evaluation of immunization efficacy.