All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
‘Ali ibn Abi Taalib said: “The Messenger of Allaah, sallallaahu ‘alayhi wa sallam, offered the ‘Aqeeqah for Al-Hasan as one sheep, and said: ‘O Faatimah! Shave his head and give the weight of his hair in silver as charity.’ So she weighed it, and it was the weight of a Dirham or part of a Dirham.” [At-Tirmithi, Al-Haakim, and others - Al-Albaani graded it Saheeh (sound)]
As for the claim that shaving the baby’s head every Wednesday for 40 weeks to make him have good knowledge, then, as far as we know, there is no revealed evidence for this. Whoever argues that this is prescribed in Islam is required to produce evidence supporting his claim.
For further benefit, please refer to Fataawa 81275 and 90729.
Allaah Knows best.