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 is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
Poetry is a type of speech, what is good in it is good and what is bad in it is bad, so poetry is not blamed for it essence, but it is its content that matters. Ibn Qudaamah said: 'There is no difference of opinion that poetry is permissible, this is the view of the companions and scholars . Poetry is needed in order to know the Arabic language and use it as evidence when interpreting the Quran, and in order to know the Words of Allaah and the sayings of the Prophet .'
Many companions recited poetry before the Prophet this is indeed mentioned in many narrations reported by Al-Bukhari and Muslim and mentioned by other reporters of Prophetic narrations. It is confirmed that the Prophet ordered Hassaan to recite poetry for him.
The texts in the Quran did not dispraise poets and the Prophet did not defame the poets. It is only the poets who lied and exaggerated who were dispraised. Usually, the poets tell lies, slander chaste women and defame innocents, so that is why they are dispraised in their totality, but those who did not do so, were not dispraised. Allaah Says (which means): {And the poets - [only] the deviators follow them. Do you not see that in every valley they roam? And that they say what they do not do? Except those [poets] who believe and do righteous deeds and remember Allaah often and defend [the Muslims] after they were wronged.}[Quran 26:222-227]. Moreover, the Sunnah did not dispraise poetry as a whole but it only dispraised reciting too much of it to an extent that it prevents someone from reading the Quran, following the Sunnah and seeking religious knowledge, or when it is erotic poetry that include courting women and so forth. For more benefits, please refer to Fatwa 86790.
Allaah Knows best.