Should ghusl be done for a woman who dies in childbirth or immediately afterwards?.
If a woman dies during childbirth or immediately afterwards, or during the period of nifaas (postpartum bleeding), then she is regarded as a martyr before Allaah, and she will have the reward of the martyrs. This is explained in the answer to question no. 8800.
But she should be washed (ghusl) and the funeral prayer should be offered for her as for any other Muslim man or woman. The Prophet (peace and blessings of Allaah be upon him) offered the funeral prayer for a woman who died during nifaas, as was narrated by al-Bukhaari (1332) and Muslim (964).
Ibn Qudaamah (may Allaah have mercy on him) said in al-Mughni (2/204): As for the shaheed who was not killed, such as one who died of a stomach disease, one who died of the plague, one who drowned, one who was crushed by a falling wall and the woman who died in childbirth, they are to be washed and the funeral prayer is to be offered for them. We do not know of any difference of scholarly opinion on this point, apart from that which was narrated from al-Hasan … the Muslims offered the funeral prayer for ‘Umar and ‘Ali (may Allaah be pleased with them), who were both martyrs.
The martyr who is not to be washed or have the funeral prayer offered for him is the one who dies in battle.
And Allaah knows best.