BackgroundPostpartum depression is the most common psychiatric disorder in pregnant women during the postpartum period and requires early detection and treatment. Previous studies have found that opioids use affects depression and anxiety disorders. Although it has long been suspected that opioids may contribute to the development of postpartum depression, observational studies are susceptible to confounding factors and reverse causality, making it difficult to determine the direction of these associations.MethodsTo examine the causal associations between opioids and non-opioid analgesics with postpartum depression, we utilized large-scale genome-wide association study (GWAS) genetic pooled data from two major databases: opioids, salicylate analgesic, non-steroidal anti-inflammatory drugs (NSAIDs), and aniline analgesics GWAS data from the United Kingdom Biobank database. GWAS data for postpartum depression were obtained from the FinnGen database. The causal analysis methods used random-effects inverse variance weighting (IVW), and complementary sensitivity analyses using weighted median, MR-Egger method, and MR-PRESSO test.ResultsIn the IVW analysis, Mendelian randomization (MR) analysis showed that opioids increased the risk of postpartum depression (OR, 1.169; 95% CI, 1.050–1.303; p = 0.005). Bidirectional analysis showed a significant causal relationship between genetically predicted postpartum depression and increased risk of opioids and non-opioid analgesics use (opioids OR, 1.118; 95% CI, 1.039–1.203; p = 0.002; NSAIDs OR, 1.071; 95% CI, 1.022–1.121; p = 0.004; salicylates OR, 1.085; 95% CI, 1.026–1.146; p = 0.004; and anilides OR, 1.064; 95% CI, 1.018–1.112; p = 0.006). There was no significant heterogeneity or any significant horizontal pleiotropy bias in the sensitivity analysis.ConclusionOur study suggests a potential causal relationship between opioids use and the risk of postpartum depression. Additionally, postpartum depression is associated with an increased risk of opioids and non-opioid analgesics use. These findings may provide new insights into prevention and intervention strategies for opioids abuse and postpartum depression.