Babies tend to get constipation when transferring from breast milk to a formula diet or a semi-solid food diet. Ensure they get enough fluids in their diet, rich with fiber-rich foods. Even if your baby has a healthy diet with plenty of liquids and fiber, some babies tend to have recurrent constipation, though not severely. In cases of chronic constipation or recurring constipation, talking to your pediatrician is the best to come up with a better treatment.