Praise be to Allah.
We have previously explained – in question no. 5000 and 5011 – the ruling on musical instruments, and that they are haraam according to the evidence of the Qur’aan and Sunnah, and according to the actions of the Sahaabah (may Allaah be pleased with them) and the words of the imams after them. This ruling applies to all kinds of music, even if it is accompanied by singing some words that have good meanings. Please review the answers to the questions mentioned.
As for singing or humming a few (poetic) verses in which there is praise of Allaah or commending some good characteristics and other good meanings, the basic principle is that poetry is words; if the words are good it is good and if they are bad it is bad. So if the words are free of any bid’ah or exaggeration that is condemned by sharee’ah, and it is free of any bad or ugly words that are inappropriate and should not be said of Allaah, then it is acceptable to sing such things occasionally, on condition that it is not done in the manner of singers and promiscuous people, because that is imitating people of immorality and sin (“and whoever imitates a people is one of them”). Hating those singers for the sake of Allaah implies that we should not resemble them or imitate their style of singing.
With regard to some words or poems which were originally said about people, it is not correct to repeat them and devote them to Allaah. Rather the believer should glorify and venerate Allaah by reciting aayahs from the Qur’aan and dhikr as prescribed in sharee’ah, and du’aa’s narrated from the Prophet (peace and blessings of Allaah be upon him), focusing on the greatness, majesty and glory of Allaah. If he occasionally recites some verses of poetry which praise Allaah and mention His blessings and bounty, there is nothing wrong with that so long as they meet the conditions mentioned above.
And Allaah knows best.