“Daughters are good deeds and sons are blessings; good deeds will be rewarded and blessings will be asked about” – how sound is this hadith and what does it mean?
Question

“Daughters are good deeds and sons are blessings; good deeds will be rewarded and blessings will be asked about” – how sound is this hadith and what does it mean?
Praise be to Allah.These words are not known to be narrated from the Prophet (blessings and peace of Allah be upon him) or from any of his companions. Rather they were quoted by some of the scholars from some of the early generations.
Abu Mansur ath-Tha‘alibi (may Allah have mercy on him) said in Durar al-Hukam (p. 24):
Ja‘far ibn Muhammad said: “Daughters are good deeds and sons are blessings; good deeds will be rewarded and blessings will be asked about.”
The Shi‘ah often quote these words in their books and attribute them to Ja‘far ibn Muhammad (may Allah have mercy on him), but what they mention in their books cannot be quoted as evidence, because they tell lies about Allah and His Messenger, and they tell lies about the early generations of this ummah.
Ibn ‘Abd al-Barr (may Allah have mercy on him) said in Bahjat al-Majalis (p. 162):
Muhammad ibn Sulayman said: Sons are a blessing and daughters are good deeds, and Allah, may He be glorified and exalted, will bring people to account for blessings and will reward them for good deeds.
Something similar was mentioned by Ibn Muflih (may Allah have mercy on him) in al-Adab ash-Shar‘iyyah (1/454), quoting from Muhammad ibn Sulayman.
Sons and daughters are both blessings that Allah, may He be exalted, bestows on people, as He says (interpretation of the meaning):
{He bestows female [offspring] upon whomever He wills, and bestows male [offspring] upon whomever He wills,
or He bestows both males and females; and He leaves barren whomever He wills. Verily, He is All-Knowing, Omnipotent} [ash-Shura 42:49-50].
It may be that what is meant by the one who said that is that the blessing of sons is greater and more perfect.
But there are a number of hadiths which speak of the virtue of raising daughters, such as that in which the Prophet (blessings and peace of Allah be upon him) said: “Anyone who is tested with daughters and treats them kindly, they will be a shield for him against the Fire.”
And he (blessings and peace of Allah be upon him) said: “Whoever takes care of two girls until they reach puberty, he and I will come like this on the Day of Resurrection” – and he held his two fingers together. Narrated by Muslim (2631).
The criterion to determine which is better is not gender; rather the criterion is righteousness, and joy is to be found in having righteous offspring.
A daughter may be better for her parents in this world and the hereafter than a son, or it may be the other way round.
Sons and daughters are both blessings, and they both come under the heading of good deeds, if Allah blesses them.
And Allah knows best.