This study aimed to compare the screening and diagnosis of maternal syphilis in Shanghai between the national and municipal prevent mother-to-child transmission (PMTCT) of syphilis policies, and then to assess whether PMTCT programs and enhancing healthcare infrastructure could bring about an early detection of maternal syphilis. Detection of maternal syphilis was initiated in 2001 and then scaled-up in 2011 along with the enhancement of antenatal healthcare infrastructure. The initial five-year periods of municipal and national PMTCT policies were defined as the "exploring period" (2002⁻2006) and the "comprehensive period" (2011⁻2015). The demographic and gestational weeks (GW) of syphilis screening and diagnosis were analyzed to identify the factors affecting early detection. During the study period, maternal syphilis screening increased from 83,718 in 2002 to 243,432 in 2015. Of the 1,894,062 pregnant women screened, 1526 and 2714 participants were diagnosed with maternal syphilis in 2002⁻2006 and 2011⁻2015, respectively. The average age of diagnosis was 28.36 years and non-residents accounted for 71.1%. In the comprehensive period, more women received early syphilis screening (14.0% vs. 10.8%) and diagnosis (13.3% vs. 7.3%) within 12 GWs compared with the exploring period. Significantly, early detection grew during 2011⁻2015, which was not seen in the exploring period. Multivariate analysis revealed a greater possibility for infected women to be diagnosed within 16 GWs (OR = 2.76) in the comprehensive period, but those who were non-residents and unemployed were less likely to receive early detection. In conclusion, early detection of maternal syphilis has been remarkably improved. More emphasis is required on the development of pro-vulnerable policies and the implementation of tailored health education to improve the accessibility of routine antenatal care and awareness of syphilis prevention.