The following infamous story is often related concerning the Amir-ul-mu’mineen :
On one occasion, a few companions saw Umar ibn al-Khattab (Allah be pleased with him) laughing and then crying; one after the other. They asked what reason made him laugh then cry. He said, “I remember that in the days of Jahiliyyah, I used to have this idol made of dates. One day, I became so hungry that I ate it. And then, I cried when I remembered digging a hole and burying my daughter alive. While I was putting her in, she reached up and brushed dirt from my beard.”
A few points to note :
1) Sayyiduna ‘Umar (radhiAllaahu ‘anhu) had a daughter called ‘Hafsa’ [i.e. Hafsa bint Umar] who was born 5 years before the Messenger of Allah ﷺ was sent with Islam. So why was was she not killed ?
2) Sayyiduna ‘Umar (radhiAllaahu ‘anhu) also had a sister called ‘Fatimah’, whom we know of upon reading about his acceptance of Islam, and she too was not harmed.
3) Thus it was not from the practice of the tribe of Sayyiduna Umar (radhiAllaahu ‘anhu) to bury their daughters, his tribe being Bani ‘Adee. And his laqab (nickname) is ‘Abu Hafs’ (after his daughter).
4) There is indeed a Hadith in Mu’jam al Kabir of Imaam Tabaraani where Nu’maan bin Basheer (radhiAllaahu ‘anhuma) narrates: Qays Bin Aasim came to the messenger of Allaah ﷺ and said that he buried his daughter whilst in Jahiliyah. So he was told to free a slave for each of his daughters, until the end of the Hadith.
In the above oft-quoted hadith, Sayyiduna Umar (radhiAllaahu ‘anhu) was only one of the narrators in the chain, however only Qays Ibn Aasim was stated as having buried his daughters, not Sayyiduna Umar or any of the other narrators !
(all the above was copy-pasted from here)
5) This narration is unfortunately widespread amongst sunnis, and may be people tend to remember this false story because of Sayyiduna ‘Umar’s well-known temper, but that is definitely not a proof in itself. Don’t establish facts by what appeals your mind.
Even if one was to believe this story, we know that what ever was done in Jahiliyah (the pre-islamic period of ignorance) is forgiven. Some famous sahabah even used to drink before its complete prohibition, are they worth less? Of course not, so what is not attested should not be spread, nor invented.
Thus, Sayyiduna Umar (radhiAllahu ‘anhu) is forgiven his previous sins just like anyone else : if a person was committing shirk before Islam and upon his conversion his act of shirk is forgiven; then what about any other sin less than shirk, which are not even confirmed subhanAllah ?
Lastly, don’t forget the shi’as are at the forefront in propagating this narration, be not of those who are pushing their agendas against those that supported the Prophet ﷺ; it is true many made the unintentional mistake of reporting this fabricated narration in biographies of Sayyiduna ‘Umar ibn-ul-Khattab, Allah be pleased with him. But now that you’re in the know, act wisely. Allah is watching how we show respect to those who strove in His cause with their wealth and their lives.
Source 1 (english)
Source 2 (english)
Source 3 (english)
Source 4 (urdu)
Source 5 (arabic)
Source 6 (arabic)
Source 7 (arabic)