The World Federation One Stop Fiqh

Ruling 583

Based on obligatory precaution, it is necessary to perform ṣalāt al‐mayyit for a child who has not completed six years of age but could understand prayers. If the child could not understand prayers, there is no problem in performing the prayer with the intention of rajāʾ [i.e. with the intention of performing it in the hope that it is desired by Allah]. There is no recommendation to perform the prayer for a stillborn child.