Constipation is a result of inadequate intake of dietary fiber. It is important to add the fiber in the diet by giving green vegetables, fresh fruits etc and also increase the free water intake of the child. Temporarily, while you correct the child's diet, you may use commercial fiber preparations like Isabgol etc. Eating sufficient fruits, vegetables, sprouts, whole grains and fluids helps in the prevention as well as the treatment of constipation.
Regular bowel habits and relaxed pace for morning routines also helps to avoid constipation. A glass of water on getting up in the morning is helpful. Many children may get a normal urge to pass a motion after that. Others may get used to passing the motion after drinking milk or after breakfast. The child should be relaxed after a while sitting on the toilet. A younger child may be encouraged to sit for about 15 minutes. The mother or others can engage him with something interesting like a toy or a book or a puzzle. If he does not evacuate, he must not be forced to do so.
The diet should have more of fiber in the form of fruits like figs (fresh as well as dry), raisins, plums, pricots and prunes; vegetables especially leafy vegetables, raw vegetables, peas, beans and sprouts; whole wheat flour chappati, and bread and unpolished rice and enough liquids. You may also try adding mashed fruits like banana and chikoo in the child's diet. A diet of vegetable soup, khichdi and ragi porridge is also recommended.
Try this home remedy: Take a ripe tomato (small one) boil it in about 1/2 glass of water. After it is nicely cooked, squeeze and extract the juice and filter the seeds and skin. Add a pinch of salt and give about 3 - 4 spoons of this extract every day. The stool pattern will become normal. It is advisable not to give commercial cereals like Cerelac.
Generally, your Pediatrician would suggest Syr Cremoffin 5 ml every day for 15 days. But this should be taken under his advice.
Note that not passing stools in a breast fed child is normal. The child may not pass stools for as long as 5-6 days, which is as normal as children who pass stools 10-15 times a day. But if the problem persists it's best to consult your Pediatrician.