Al-Tirmidhi (1522) narrated that Samurah said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “The boy is in pledge for his ‘aqeeqah which should be slaughtered on his behalf on the seventh day, and he should be named and his head shaved.” This hadeeth was classed as saheeh by al-Albaani in Saheeh al-Tirmidhi, and it indicates that it is mustahabb to shave the hair of the newborn.
The fuqaha’ differed with regard to shaving the head of a female newborn. The Maalikis and Shaafa’is are of the view that it should be shaved as the male’s head is shaved. The Hanbalis are of the view that it should not be shaved.
The Shaafa’is quoted as evidence for shaving the head of a female the mursal report narrated by Maalik, al-Bayhaqi and others from Muhammad ibn ‘Ali ibn al-Husayn who said: Faatimah the daughter of the Messenger of Allaah (peace and blessings of Allaah be upon him) weighed the hair of Hasan, Husayn, Zaynab and Umm Kalthoom, and gave the equivalent weight in silver in charity. Al-Bayhaqi also narrated it in a marfoo’ report from ‘Ali (may Allaah be pleased with him) who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) told Faatimah to give charity equal to the weight in silver of the hair of al-Husayn. Al-Nawawi said: There is some weakness in its isnaad.
The argument of the Hanbalis is based on the fact that in principle women are not allowed to shave their heads, and there is no report concerning shaving the newborn except in the case of a boy.
Ibn Qudaamah said in al-Mughni (1/104): It is proven in the reports that it is makrooh for a woman to shave her head unnecessarily. Abu Moosa said: The Messenger of Allaah (peace and blessings of Allaah be upon him) disavowed himself of women who raise their voices and shave their heads (at times of loss). Agreed upon.
Al-Khallaal narrated with his isnaad from Qataadah that ‘Ikrimah said: The Prophet (peace and blessings of Allaah be upon him) forbade women to shave their heads, and al-Hasan said: It is mutilation – i.e., changing the creation of Allaah.
Because there is no saheeh hadeeth which speaks of shaving the head of a newborn female, the principle remains, which is that it is forbidden to shave the head.
See: Sharh al-Khurashi ‘ala Mukhtasar Khaleel (3/48); al-Majmoo’ (8/406); Kishshaaf al-Qinaa’ (3/29).
With regard to the command to remove the harm that is mentioned in the words of the Prophet (peace and blessings of Allaah be upon him), “With the boy there is his ‘aqeeqah so shed blood on his behalf and remove the harm from him” (narrated by al-Bukhaari (5471), the phrase “remove the harm” may be interpreted in different ways. It was said that what is meant is shaving the head, or removing any dirt that is on it, such as blood etc. So it may be understood that it means it is mustahabb to wash it.
Al-Haafiz said in al-Fath (9/593): In the hadeeth of Ibn ‘Abbaas that is narrated by al-Tabaraani it says: “Remove the harm from him and shave his head.” So he added the idea of shaving the head after saying remove the harm. Therefore we should interpret the word adha (harm) as referring to something more general in meaning than shaving the head. This is supported by the fact in that some versions of the hadeeth of ‘Amr ibn Shu’ayb it says: “and wipe the dirt from him”. Narrated by Abu’l-Shaykh. End quote.
Whatever the case, the hadeeth refers to boys only (ghulaam) and this supports the view of the Hanbalis.
And Allaah knows best.