Pneumonia caused by Mesomycoplasma hyopneumoniae (Mhp) is a respiratory disease with high morbidity and low mortality that typically presents in growing pigs. Although often subclinical, the disease can significantly affect the pig farming industry economically due to decreased growth rates and inefficient feed conversion. Effective control of Mhp depends on the detection of dominant strains prevalent in infected animals, which vary in virulence. However, traditional culture methods for diagnosing Mhp are laborious and slow, whereas multi-locus sequence typing, another possible method, requires identifying several genes. This study introduces a novel pair of polymerase chain reaction (PCR) primers for the rapid detection and genetic evolution analysis of Mhp strains to facilitate improved vaccine selection. The genetic evolutionary tree established using the PCR amplification fragment was highly similar to the genetic evolutionary tree established using whole-genome sequences. Analysis of 131 samples from Guangxi and Hunan slaughterhouses revealed a 30.53 % prevalence of Mhp. High-throughput sequencing has shown that Mhp has a diverse bacterial population in clinically collected samples. The prevalence of major strains may vary among regions. Additionally, the strains of Mhp vaccines sold may differ significantly from the strains prevalent on farms. In summary, this work has designed a pair of primers that will be useful for detecting the diversity of Mhp and for targeted prevention and control.