Guidelines for healthy infant feeding provide advice on breastfeeding and complementary feeding. The Avon Longitudinal Study of Parents and Children (ALSPAC) derived dietary patterns in comparison to infant feeding guidelines and by using principal components analysis (PCA). The ALSPAC cohort was recruited during pregnancy. Parent-completed questionnaires assessed diet at age 6 and 15 months. Children were weighed and measured at 7 years of age and IQ was assessed at 8 years. A complementary feeding utility index was calculated in relation to 14 feeding recommendations. High scores on the index were due to longer breastfeeding, and feeding more fruit and vegetables and less ready-prepared baby foods. The index scores were positively related to IQ and 'healthy' dietary patterns in childhood. In infancy four dietary patterns were derived from PCA at each age. Three occurred at both ages: 'HM traditional' (home-made meat, vegetables and desserts), 'discretionary' (processed adult foods) and 'RM baby foods' (commercial ready-made baby foods). A 'breastfeeding' pattern was derived at 6 months, with fruit and vegetables included. At 15 months, a 'HM contemporary' pattern included cheese, fish, nuts, legumes, fruit and vegetables. The 'discretionary' and 'RM baby foods' patterns at both ages were negatively associated, while the 'breastfeeding' and 'HM contemporary' patterns were positively associated with IQ. These results suggest that infant diet influences cognitive development in children and may set a trend for later eating patterns.