Objective: Observational studies have described that dietary habits are associated with postpartum depression (PPD), but these results are liable to influence by residual confounding. We aimed to identify the causal effects of dietary habits on PPD by applying the Mendelian randomization (MR) method. Design: A two-sample MR study. Setting: Summary statistics from published genome wide association studies (GWAS) in European ancestry populations. Population or Sample: Instrumental variants for 23 dietary habits were obtained from 11 studies on 3,831,176 participants. Methods: Two-sample MR framework and sensitiviry analyses were performed to examine the causal association between all exposures and PPD. Main Outcome Measures: Genetic association estimate for PPD was extracted from the FINNGEN consortium. Result: Higher genetically predicted selenium (odds ratio [OR] per standard deviation 1.32e+05, 95% confidence interval [CI] 19.827 to 8.75e+08, P = 0.009) and vitamin B12 (OR 4.24e+14, 95% CI 63.742 to 2.82e+27, P = 0.025) increased the risk of PPD. However, fish oil (OR 4.03e-03, 95% CI 3.81e-03 to 0.427, P = 0.026) reduced the risk of PPD. Conclusions: This MR study provides robust evidence that selenium and vitamin B12 increases the risk of PPD, meanwhile fish oil decreases the risk of PPD. It suggested that adjustments targeting selenium, vitamin B12, and fish oil may contribute to the primary prevention of PPD.