"And the poets, the deviators follow them" [Shuara 26:224]. Then this was abrogated, and an exception was made, for He said, "Except those who believe and do righteous deeds and remember Allah much" [Shuara 26:227].
{والشعراه يتبعهم الغاون} فنسخ من ذلك واستثنى فقال: {إلا الذين آمنوا وعملوا الصالحات وذكروا الله كثيرا}
Abu Dawud (5016) and Bukhari in Adab al-Mufrad (871) both narrated it, from the hadith of Ali bin Husayn, from his father, from Yazid Nahwi, from Ikrima, from Ibn Abbas, who related it.Its chain is hasan due to the disagreement concerning Ali bin Husayn bin Waqid Marwazi, for his hadith is graded hasan when his divergence in the text or the chain is not established. This supports Ibn Abbas's statement that the Prophet ﷺ permitted Muslim poets to praise the Prophet ﷺ, call to Islam, and defend it.His statement, "so this was abrogated from that," means specification, and it is understood from Ibn Abbas's statement that this verse is Madinan, although it is established that Surah Shuara was revealed in Makkah. Nahhas said in Nasikh wal-Mansukh that Surah Shuara is Makkan except for these verses, which were revealed in Madinah.This is supported by what Ibn Abu Shayba narrated in Musannaf (26574), from Yahya bin Wadih, from Muhammad bin Ishaq, from Yazid bin Abdullah bin Qusayt, from Abu Hasan Barrad, who said, "When this verse was revealed, "And the poets, the deviators follow them" [Shuara 26:224], Abdullah bin Rawaha, Kaab bin Malik, and Hassan bin Thabit came to the Messenger of Allah ﷺ weeping, and they said, 'O Messenger of Allah, Allah has revealed this verse while He knows that we are poets.' He said, 'Read what comes after it, "except those who believe and do righteous deeds" [Shuara 26:227], that is you, "and defended themselves" [Shuara 26:227], that is you.'"These poets were among the Ansar of Madinah, except that its chain is mursal, for I have not found anyone who mentioned Abu Hasan Barrad, who is a client of Tamim Dari, one of the companions.