It is rare for an exclusively breastfed baby to become constipated. If your newborn isn’t having around five bright yellow poops by their fifth day, the problem could be lack of food, not constipation. When it does happen, it may be due to reactions to milk proteins in formula or even a reaction to milk proteins in the mother’s diet. Babies transitioning to solid foods are more likely to get constipated, especially if they eat too much rice cereal. If introducing foods like bananas and broccoli or more fruit juice and liquid doesn’t help relieve things, talk to your pediatrician before trying other remedies.
Source: https://www.sheknows.com/