Ibn Rajab said:
“As for the inner affairs, then if one’s intention in doing that (criticism) is to just clarify the truth so that the people will not be deceived by the saying of someone who erred in his opinions, then there is no doubt that this individual will be rewarded for his intention. And by doing this with this intention, he falls into the category of being from those who show sincerity to Allaah, His Messenger, the leaders of the Muslims and their common folk…
But if the intention of the one refuting is to expose the faults of the one being refuted and to debase him and manifest his ignorance and shortness of knowledge, then this is forbidden whether the refutation is done in the presence of the one being refuted or in his absence, or whether it is done during that person’s lifetime or after his death.
This type of action falls under the acts which Allaah condemns in His book and which he threatens the one who does it, concerning his slander and backbiting.
It also falls into the statement of the Prophet (saw):
‘O you group of people that believe with your tongues but not with your hearts! Do not abuse the Muslims nor seek after their faults, for indeed, he who seeks after their faults, Allaah will seek after his faults. And whoever has Allaah seek after his faults, he will expose them, even if he may have committed them in privacy of his own home.‘
All of this talk is with respect to the scholars that are followed in the religion. As for the people of innovation and misguidance and those who imitate the scholars but are not from them, then it is permissible to expose their ignorance and manifest their deficiencies, in order to warn others against following them.”
[Al-Farq Bayna An-Naseeha Wat-Ta’yeer, p.30-33]