Prenatal distress and cortisol were associated with both child gut microbiota composition and fecal metabolome at preschool age. Understanding these associations may allow for the identification of microbiota-targeted interventions to support child developmental outcomes affected by prenatal stress.