The effect of phototherapy on breastmilk feeding is unclear. To estimate the effect of inpatient phototherapy on breastmilk feeding at 2-month well-child visits. We performed a retrospective cohort study using electronic health record data. From births at 16 Kaiser Permanente Northern California hospitals (2013-2017), we identified a cohort of infants ≥ 35 weeks’ gestation with total serum bilirubin levels close to the American Academy of Pediatrics 2004 phototherapy threshold during their birth hospitalisation. We compared self-reported breastmilk feeding at 2-month well-child visits among those who had and had not received birth hospitalisation phototherapy, adjusting for bilirubin levels and other confounding variables. We used multiple imputation (K = 200) to address missing data. Approximately a quarter of infants in the cohort (24.5%) received phototherapy during their birth hospitalisation. At the 2-month visit, exclusive breastmilk feeding was less common (RR 0.91, 95% interval [CI] 0.88, 0.95) among those who received phototherapy (41.3%) than those who did not (45.2%). However, no association remained after adjusting for potential confounders (RR 0.99, 95% CI 0.95, 1.04; average treatment effect on the treated [ATET] -0.2%, 95% CI -2.0%, 1.5%). In contrast, any breastmilk feeding was similar between infants who did (76.8%) and did not get phototherapy (77.9%). After adjusting for confounders, phototherapy had a slightly positive association with any breastmilk feeding at 2 months (RR 1.02, 95% CI 1.00, 1.04). Among infants who received phototherapy, the proportion being fed any breastmilk at the 2-month visit was an estimated 1.6 percentage points higher than it would have been if they had not received phototherapy (ATET 1.6%, 95% CI 0.1%, 3.1%). Multiple imputation results were similar. Birth hospitalisation phototherapy can be delivered in a way that does not adversely affect breastmilk feeding at 2 months.