This is not true. If she wishes, she can breastfeed for 2 years only and it is not a must on her.

Mothers may breastfeed their children two complete years for whoever wishes to complete the nursing [period]. Upon the father is the mothers’ provision and their clothing according to what is acceptable. No person is charged with more than his capacity. No mother should be harmed through her child, and no father through his child. And upon the [father’s] heir is [a duty] like that [of the father]. And if they both desire weaning through mutual consent from both of them and consultation, there is no blame upon either of them. And if you wish to have your children nursed by a substitute, there is no blame upon you as long as you give payment according to what is acceptable. And fear Allah and know that Allah is Seeing of what you do. (Quran 2:233)

Is is mandatory for a woman in Islam to breast feed her child for 3 complete years?

Breast Feeding |