Whoever knows allah truly will make all his deeds sincere to Him. For riya occurs when someone lacks knowledge of His Creator, when he does not glorify Allah as should be, when the inner self seeks people's compliments and praise.
People vary in this disease, some seek praise from others only, some seek [the pleasure of] Allah in their deeds as well as people's praise, some do not seek people's praise at all, however when people see them doing good deeds, they improve their work to be praised. In the latter case it becomes a lesion that has affected a good deed.
The general cure for this disease is to know Allah truly. For whoever knows Him would make all his actions sincerely for Him and would not see anyone besides Him. He would locate himself in the position of the worshipper, who is humble to his Worshipped Lord, not in the position of the praised worshipped Lord. He would know that reward is given only for sincere deeds, therefore he should be aware of the wasted exhaustion (of performing acts for other than the sake of Allah).
Moreover he should know that punishment for riya is severe. Umar ibn al-Khattab (ra) narrated that the Prophet (saw) said, "Deeds are considered by their intention, and a person will be rewarded according to his intention." [Bukhari and Muslim]
Abu Musa (ra) narrated that a man came to the Prophet (saw) and said, "O Messenger of Allah! Tell me if a man fights in the battlefield out of valor, out of zeal, and out of hypocrisy, which of these is considered fighting in the cause of Allah?" The Messenger said, "He who fights in order that the word of Allah reigns supreme, is considered as fighting in the cause of Allah." [Bukhari and Muslim]
It was narrated from Abu Hurayrah (ra) that Natil Ashami said, "O Shaykh! Relate to us a hadith that you have heard from the Messenger of Allah (saw)." Abu Hurayrah (ra) said, "I heard the Messenger of Allah (saw) say, 'The first to be judged on the Day of Judgement will be a man who died as a martyr. He shall be brought forth. Allah will make him recount His blessings (i.e. the blessings which He had bestowed upon him) and he will recount them (and admit having enjoyed them in his life). (Then) Allah will say: What did you do (to requite these blessings)? He will say: I fought for you until I died as a martyr. Allah will say: You have told a lie. You fought that you might be called "a brave warrior". And you were called so. (Then) orders will be passed against him and he will be dragged with his face downward and cast into Hell. Then will be brought forward a man who acquired knowledge, who imparted it (to others) and recited the Quran. He will be brought, Allah will make him recount His blessings, he will recount them (and admit having enjoyed them in his lifetime). Then Allah will ask: What did you do (to requite these blessings)? He will say: I acquired knowledge and disseminated it and recited the Quran seeking your pleasure. Allah will say: You have told a lie. You acquired knowledge so that you might be called 'a scholar' and you recited the Quran so that it might be said: 'He is a reciter' and such has been said. Then orders will be passed against him, he shall be dragged with his face downward and cast into the Fire. Then will be brought a man whom Allah had made abundantly rich and had granted every kind of wealth. He will be brought, Allah will make him recount His blessings, he will recount them (and admit having enjoyed them in his lifetime). Allah will (then) ask: What have you done (to requite these blessings)? He will say: I spent money in every cause in which you wished that it should be spent. Allah will say: You are lying. You did (so) that it might be said about (You): 'He is generous' and so it was said. Then Allah will pass orders, he will be dragged with his face downward and thrown into Hell." [Muslim]
Abu Hurayrah (ra) narrated that the Prophet (saw) narrated from his Lord that He said, "I am the best of partners, so whoever does an act of worship, committing shirk in it, I am free from him, and he is left to the partner he associated Me with." [Muslim, Ahmad, Ibn Khuzaymah and Ibn Majah]
Mahmud ibn Lubayd (ra) narrated that the Messenger of Allah (saw) said, "What I fear for you the most is minor Shirk!' They said, 'O Messenger of Allah! What is that?' He said, 'riya'. Allah, Exalted is He, says on the Day of Judgement, after he recompenses people for their deeds: Go to those who you used to show your deeds off to and see if they have a recompense." [Ahmad]
Abu Hazim said, "No servant (of Allah) betters what is between him and other servants, and he does not spoil what is between him and Allah, except that Allah spoils what is between him and the servants of Allah. Working for the sake of one face is easier than working for the sake of all faces. For if you work for the sake of that face (the face of Allah), all faces will turn to you but if you spoil it, all faces will detest you." [Abu Nuaym, Al-Hilyah]
Ibn Tawbah Abu Jafar Abdullah said, "I saw Abu Bakr al-Adami, the reciter, in a dream after his death, begging. I told him, 'What did Allah do with you?' He said, 'I have stood in front of Him and I have suffered many tribulations.' So I told him, 'What about the nights, the good deeds, and the Quran?!' He said, 'There was nothing that was worse for me than them because I did them all for [the sake of] dunya!' I said, 'So what happened to you?' He said, 'Allah, May He be exalted, told me, 'I took it upon myself not to torture anyone who reached eighty years of age."
The Virtue of the Mind
Dispraise of Hawa (desires)
The Difference Between the Perspective of Mind and the Perspective of Hawa
Averting Passionate Love (Ishq)
Averting Gluttony (Sharah)
Refusing to take a Position of Authority in this world
Prohibition on Squandering
Elucidation on the Amount of Earnings and Expenditure
Dispraise of Lying
Averting Riya (Insincerity and Pretentiousness)
Averting Excessive Thinking
Averting Excessive Sadness
Averting Ghamm (Grief) and Hamm (Worry)
Averting Excessive Fear and Cautiousness of Death
Averting Excessive Happiness
Identifying One's Flaws
Motivating a Low Endeavor
Disciplining and Handling Family and Slaves
Consorting with People
Flawlessness of Character