The ruling on poetry is the same as the ruling on speech or words, of which it is a part. The well known, general principle is that which is narrated in Mursal ‘Urwah ibn al-Zubayr: “Poetry is like speech: what is good is good, and what is bad is bad.”
If the poetry involves words of love to a specific woman who is not permissible for the poet, or encourages sin, then it is haraam poetry.
But if it includes remembrance of Allah, blessings upon the Messenger of Allah, encouraging good qualities and good conduct, then it is poetry that is mustahabb and recommended.
If it includes material that is neither makrooh nor mustahabb, rather it includes permissible matters, then it is permissible poetry, and this is the basic, original ruling concerning it, that it is permissible.
Ibn Qudaamah (may Allah have mercy on him) said:
There is no difference of opinion concerning the permissibility of poetry. This was stated by the Sahaabah and the scholars. End quote.
For more quotations from the scholars on the ruling on poetry, please see al-Mawsoo‘ah al-Fiqhiyyah, 26/113-117
Based on the above, it is possible to learn the ruling on earning money by writing poetry. If an action is basically permissible, it is basically permissible to earn money from it, and the ruling does not change to it being haraam or makrooh except for a reason.
The fuqaha’ (may Allah have mercy on them) stated that the ruling on earning money through poetry is subject to further discussion:
1. If the poet is earning money from his poetry because the people are scared that he will lampoon them or slander their honour, and they only give him money so as to ward off his evil and make him hold his tongue, this wealth is undoubtedly ill-gotten and is haraam.
2. If the poetry is permissible or mustahabb, and the poet acquires some money because of his poetry, there is nothing wrong with this at all.
It says in Radd al-Muhtaar (5/272), which is a Hanafi book:
Ill-gotten wealth includes that which a poet receives for his poetry -- because he is usually only given money to make him hold his tongue.
But if he is a person from whose evil people are safe, then it seems that what he is given is halaal, based on the fact that the Prophet (blessings and peace of Allah be upon him) gave his cloak to Ka‘b when he praised him in his famous qaseedah (ode). End quote.
Shaykh ‘Abd al-‘Azeez ibn Baaz (may Allah have mercy on him) was asked the following question:
Is it permissible to earn money through poetry?
If the poetry is permissible and good, and is in the interests of the Muslims, and the author sells it and earns from it, such as poetry about Islamic etiquette, poetry about rulings or poetry about permissible matters, and then he sells them (his poems), there is nothing wrong with it, as in the case of books which are written by people and sold. End quote.
Quoted from the Shaykh’s website:
And Allah knows best.