Aim Our aim was to use text message questions to obtain prospective, real-time data on exclusive and partial breastfeeding and introduction to complementary foods in a Danish birth cohort. We also wanted to identify factors influencing breastfeeding initiation and cessation. Methods This study formed part of the Odense Child Cohort and focused on mothers who gave birth to full-term singletons between April and October 2012. They received the same three to five questions, about breastfeeding, infant formula and introduction to complementary food, three days after birth and then at weekly intervals. Results We recruited 499 mothers, and the response rate to the first of the weekly questions was ≥89.4% during the study. Three days after birth, 96.7% of mothers were breastfeeding, 61.2% exclusively and 30.2% partially, and 26 weeks after birth 60.2% of mothers were breastfeeding, 1.1% exclusively. Complementary food was introduced at an average age of 20 weeks. Breastfeeding cessation was associated with maternal smoking, lower maternal age and supplementation with infant formula in the first days after birth (all p < 0.05). Conclusion Most mothers initiated breastfeeding, but only 1.1% were exclusively breastfeeding at 26 weeks. Text messaging resulted in high response rates and was a feasible data collection method.