Kindly consider dietary modifications like increasing water and fibre in child's diet.
Certain foods like isabgol in curd, papaya, bananas, raisins soaked overnight will help.
Give whole fruit instead of fruit juices and give chapati/vegetables with soups to add fibre.
Restrict milk to 2 cups per day.
Next Steps
Check anal region for any local problem.