How to Treat It. A change in formula or in Mom's diet could help combat constipation in formula and breastfed babies, respectively. Solid foods, which are often the cause of constipation, can also be the cure, Dr. Shu says.f your baby has a milk-protein allergy or intolerance, she could end up constipated. A milk-based formula could cause this, as well as the dairy in mom's diet that's passed through the breast milk. This also carries over to any other kinds of dairy an older baby could consume, such as yogurt and cheese.