Question:
When he prays in the mosque, thoughts of showing off — Riya — sometimes come to his mind. But when he prays alone at home, those feelings do not arise. What should he do in such a situation?
Answer:
First, we must understand an important principle in Islam. Unwanted thoughts that enter the mind are not sinful. A person is not held accountable for every thought that passes through the heart.
Real Riya (Showing Off)— the sinful kind — is when a person performs an act of worship purely so that people will see him and praise him. That is the intention from the beginning: to be seen, to be admired. That is blameworthy.
But if a person stands in prayer sincerely for the sake of Allahﷻ , and during the prayer certain thoughts arise — thoughts about people watching, thoughts about appearance — that is something different. Those are intrusive whispers, what we call waswasah.
Even the companions experienced this. They once came to the Prophetﷺand complained about disturbing thoughts that entered their hearts, thoughts they felt ashamed even to mention. The Prophetﷺreplied that such feelings are actually a sign of faith. The fact that a person is disturbed by those thoughts shows that his heart cares about sincerity.
The Prophetﷺalso explained that when believers perform good deeds and people praise them for it, that praise can be an early glad tiding for the believer. It is not automatically Riya.
Furthermore, Allahﷻ in His mercy has declared that involuntary thoughts that cross the mind are forgiven. As long as a person does not deliberately act upon them or intentionally cultivate them, Allahﷻ overlooks them. This principle is mentioned in authentic narrations, including reports in Sahih al-Bukhari.
In reality, every human being has experienced distractions in prayer. Thoughts come and go. The mind wanders. If someone claims that he always prays with perfect concentration and never experiences any distraction, he is not telling the truth.
Even in the life of the Prophetﷺwe see examples that teach us about human distraction. On one occasion, he was wearing a garment with patterns, and those patterns momentarily distracted him during prayer. After the prayer he asked for a plain garment instead. This shows that even small distractions can occur.
So what should you do? Continue praying in the mosque. Do not abandon the congregational prayer because of these thoughts. Ignore them and continue your worship. In fact, sometimes these thoughts themselves become a sign of sincerity. A hypocrite does not worry about riya. Only a believer fears it.
You can only pray as a human being — and human beings have thoughts. Various ideas pass through the mind during prayer. Some people, especially certain individuals who present themselves as spiritual elites, tell the public: “You ordinary people pray with many thoughts in your minds. We are not like that.” They claim that their minds are completely empty and pure during prayer.
Such claims are deception. They try to portray themselves as spiritually superior. That is not the reality of human nature. Human beings were not created without thoughts. The mind naturally produces ideas, memories, and emotions. What matters is this: did you deliberately create those thoughts, or did they come without your choice?
In Sahih Bukhari 2528; The Prophetﷺ (ﷺ) said, “Allahﷻ has accepted my invocation to forgive what whispers in the hearts of my followers, unless they put it to action or utter it.”
If thoughts of showing off, pride, or self-admiration enter your mind without your intention, then you should ask yourself: will Allahﷻ ﷻ hold you accountable for something that you did not choose? Will He punish you for something that came into your heart against your will?
Of course not. Instead, you should turn to Allahﷻ and say: “O Allahﷻ , I did not create this thought. It entered my heart without my choice. I seek Your protection from it.”
Allahﷻ overlooks such involuntary thoughts and forgives them. That is how this matter should be understood.