The influence of childhood nutrition on the development of constipation beyond the period of weaning and breastfeeding is relatively understudied. In addition, eating patterns in childhood can be highly correlated with overweight and sedentary behaviour, which may also have an influence on constipation. The aim of this study was to assess whether common dietary patterns, sedentary behaviour and childhood overweight are associated with constipation in childhood. The study was embedded in a population-based prospective birth cohort. Information on dietary intake was obtained by a food frequency questionnaire at the child's age of 14 months (n = 2420). The adherence scores on a 'Health conscious' and 'Western-like' diet were extracted from principal component analysis. At the age of 24, 36 and 48 months, information on constipation and sedentary behaviour, and weight and height was obtained by parental-derived questionnaires and from the child health centres, respectively. Adherence to a 'Western-like' dietary pattern was associated with a higher prevalence of constipation up to 48 months [adjusted odds ratio (aOR); 95% confidence interval (CI): 1.39; 1.02-1.87], which was not mediated by overweight or sedentary behaviour. Adherence to a 'Health Conscious' dietary pattern was only associated at short term, with a lower prevalence of constipation at 24 months (aOR; 95%CI: 0.65; 0.44-0.96). No association was found between overweight, sedentary behaviour and constipation. Our results suggest that specific dietary patterns in early childhood could be associated with higher or lower risks for constipation, but these effects are time-dependent. Overweight and sedentary behaviour seem to not have a major role on constipation in childhood.