Sunan Abi Dawud, Book 43, Hadith 244 (Abu Dawud 5018)

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."