Previous research has explored theories regarding the vertical transmission of human papillomavirus (HPV) infection and its association with adverse pregnancy and perinatal outcomes. However, the impact of maternal HPV infection on congenital anomalies (CAs) in offspring remains relatively understudied. We conducted a population‐based cohort study linking the Taiwan Birth Registry, Taiwan Death Registry, and National Health Insurance Research Database, in which newborns born in Taiwan between 2009 and 2015 were included. We established a maternal HPV infection cohort comprising 37 807 newborns and matched them with a comparison group of 151 228 newborns at a 1:4 ratio based on index year, age, and sex. The study examined a composite outcome and subgroups of different types of congenital malformations. Differences in cumulative incidence of CAs were assessed using Kaplan–Meier curves and log‐rank tests. Adjusted hazard ratios (aHRs) were estimated using Cox proportional hazard regressions. No significant association was found between HPV infection and the broad spectrum of CAs (aHR: 1.04, 95% confidence interval [CI]: 0.98–1.10; log‐rank test p = 0.14). However, we observed a 19% increased risk of musculoskeletal CAs in the maternal HPV infection group (aHR: 1.19; 95% CI: 1.05–1.34) compared to those without maternal HPV exposure. Other factors, including the type of HPV (aHR: 0.65; 95% CI: 0.16–2.63), the timing of exposure (during or before pregnancy), and maternal age (aHR for <30 years: 1.02, 95% CI: 0.94–1.1; aHR for 30–39 years: 1.05, 95% CI: 0.99–1.11; aHR for ≥40 years: 0.88, 95% CI: 0.67–1.17), did not significantly affect the risk for any CA. In conclusion, gestation detection of HPV infection was associated with musculoskeletal CAs but not other major CAs. Prospective studies are warranted to elucidate the necessity of prenatal screening in populations at risk.