Mycoplasma pneumoniae (MP) is a significant cause of community-acquired pneumonia with high macrolide resistance rates. Various COVID-19 pandemic restrictions have impacted the prevalence of MP. To assess the changes in the pattern of MP infections among children before, during, and after the COVID-19 pandemic. A total of 36685 enrolled patients, aged 0-18 years, diagnosed with pneumonia and admitted to Children's Hospital of Chongqing Medical University from January 2019 to December 2023, were retrospectively reviewed in this study. The epidemiological characteristics of pediatric MP infection were analyzed. Among 36685 patients, 7610 (20.74%) tested positive for MP. The highest positive rate was observed among children aged over 6 years (55.06%). There was no gender disparity in MP infection across the three phases of the COVID-19 pandemic. Hospital stays were longest for children during the COVID-19 pandemic (P <0.001). MP infection was most prevalent in the summer (29.64%). The lowest positive rate was observed during the pandemic, with the highest rate found after easing the measures across all age groups (P <0.001). There was a surge in the positive rate of MP in the third year after the COVID-19 pandemic. Regression analyses demonstrated a shift in the age range susceptible to MP infection, with children aged 3.8 to 13.5 years post-pandemic compared to the pre-pandemic range of 5.3 to 15.5 years old. Additionally, the average macrolide resistance rate was 79.84%. We observed a higher resistance rate during the pandemic than in the pre- and post-pandemic phases (P <0.001). The restrictive measures implemented during the COVID-19 pandemic have influenced the spread of MP to some extent and altered demographic and clinical characteristics, such as age, age group, season, length of stay, and macrolide resistance. We recommend continuous surveillance of the evolving epidemiological characteristics of MP infection in the post-pandemic period when restrictions are no longer necessary.