Background. The global strategy on infant and child feeding recommends the best pattern of feeding for infants and young child feeding (IYCF) from birth to 24 months. Practices of proper feeding of children up to 2 years of age contribute to a child’s survival, growth, and development because they can prevent micronutrient deficiencies, morbidity, and obesity in later life. This study aims to determine the risk factors for the failure of IYCF practice in urban and rural Indonesia. Materials and Methods. The study used Indonesia Demographic and Health Survey (IDHS) 2017 data with a cross-sectional research design. The sampling technique used systematic probability proportional to size sampling. The number of samples was 4,869 children consisting of 2,424 children in urban and 2,445 children in rural. Bivariate analysis using chi-square test. Multivariate analysis using multivariate logistic regression. Results. The study found that most of the children in urban (79.3%) and rural (97.2%) did not practice IYCF under the recommendations. There is a difference in the proportion of IYCF practices between urban and rural areas (p <0.001). The risk factors for the failure of IYCF practice in urban areas are socioeconomic, maternal age, and age at first marriage. The poorest socioeconomic is at risk of 2.4 times, maternal age > 35 years are at risk of 1.5 times, age at first marriage is less than 21 years at risk of 2.1 times carrying out IYCF practices not according to recommendations compared to the comparison group. The risk factors for the failure of IYCF practice in rural are socioeconomic, maternal education, quantity, and quality of antenatal care (ANC). The poorest socioeconomic is at risk of 2.1 times, mothers with primary education are at 1.5 times, the quantity of ANC is not good at risk at 1.9 times, the quality of ANC is not good risk at 1.5 times practicing IYCF is not according to the recommendations compared to the comparison group. Conclusion. The practice of IYCF in Indonesia starting from giving early breastfeeding initiation, exclusive breastfeeding, and complementary feeding according to recommendations is still low. The priority of IYCF intervention through education and assistance to pregnant women needs to be a sustainable program.