Hadithcore
Sunan Abi Dawud, 5016
hasan· Al-Albani

Ibn ‘Abbas said :

The verse “And the poets it is those straying in evil who follow them. He (Allah) then abrogated it and made an exception saying: Except those who believe and work righteousness, engage much in the remembrance of Allah."

حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدٍ الْمَرْوَزِيُّ، قَالَ حَدَّثَنِي عَلِيُّ بْنُ حُسَيْنٍ، عَنْ أَبِيهِ، عَنْ يَزِيدَ النَّحْوِيِّ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، قَالَ ‏{‏ وَالشُّعَرَاءُ يَتَّبِعُهُمُ الْغَاوُونَ ‏}‏ فَنَسَخَ مِنْ ذَلِكَ وَاسْتَثْنَى فَقَالَ ‏{‏ إِلاَّ الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ وَذَكَرُوا اللَّهَ كَثِيرًا ‏}‏ ‏.‏

References2 variants
In-Book Reference
Book 43, Hadith 244
English Reference
Book 42, Hadith 4998