QuranHub · Online Quran Academy
Bad Thoughts During Salah: What to Do
By Nazeer AhmadFounder, QuranHub Online Quran AcademyM.A. Arabic & IslamiyatDars-e-Nizami (Tanzeem-ul-Madaris)10+ years teaching Quran and Islamic studies
You are standing in prayer when a shameful thought arrives — about Allah, about something filthy, about something you would be horrified for anyone to know you thought. Your first instinct is that the prayer is ruined and you must start again, and your second instinct is shame. Hear this before anything else: a bad thought during salah does not break your prayer, and it does not make you a hypocrite. It happened to the companions, it happened to a man the Prophet himself advised, and there is a clear, practical remedy.
This guide gives you that remedy step by step, explains why you should not restart your prayer, and shows how to bring your heart back when it wanders. This is guidance, not a fatwa — and if intrusive thoughts are harming your daily life, please speak to a qualified scholar and a mental-health professional.
- Free 3-day trial · no credit card
- Live 1-on-1 online classes
- Qualified male & female tutors
- In every timezone
Bad thoughts in salah are not new
Uthman ibn Abi al-As came to the Prophet and said: 'Allah's Messenger, the Satan intervenes between me and my prayer and my reciting of the Quran and he confounds me.' The Prophet did not tell him his prayer was worthless, and he did not tell him to pray harder. He named the cause — 'That is a devil who is known as Khinzab' — and gave him a remedy: 'when you perceive its effect, seek refuge with Allah from it and spit three times to your left.' Uthman said: 'I did that and Allah dispelled that from me' (Sahih Muslim 2203a).
The point is worth sitting with: a companion of the Prophet, a man of great faith, had his prayer and his recitation confused by a devil — and the Prophet treated it as a known problem with a known cure, not as a spiritual disaster. Your experience is the same problem, and the cure is the same. You are not uniquely broken, and your prayer is not uniquely ruined.
- A companion's prayer and recitation were confused by a devil named Khinzab (Sahih Muslim 2203a)
- The Prophet named the cause and gave a remedy — he did not condemn the man
- Bad thoughts in salah are a known problem with a known cure, not a spiritual disaster
- Your prayer is not uniquely ruined — this happened to the best of people
The Prophetic remedy, step by step
When the bad thought or the confusion comes in the middle of prayer, do three things, in order, and then carry on. First, seek refuge with Allah in your heart — say 'A'udhu billahi minash-shaytanir-rajim' quietly to yourself. The Prophet taught this refuge as the first answer to the whisper: 'And if an evil suggestion comes to you from Satan, then seek refuge in Allah' (Quran 7:200). Second, give a light, dry spit to your left three times — a small puff of breath, no saliva, done discreetly so you do not disturb anyone praying beside you.
Third — and this is the step most people skip — carry on with your prayer from where you left off. Do not restart the surah. Do not restart the rak'ah. Do not restart the prayer. Uthman did what he was told once, and Allah dispelled it from him. The remedy works by being used and then left behind, not by being repeated until the feeling of safety arrives.
- Seek refuge quietly: 'A'udhu billahi minash-shaytanir-rajim' (Quran 7:200)
- Give a light, dry spit to your left three times — a puff of breath, done discreetly (Sahih Muslim 2203a)
- Carry on from where you left off — do not restart the surah, the rak'ah, or the prayer
- Use the remedy once, then leave it behind — do not repeat it until a feeling of safety arrives
Thoughts about Allah or filthy thoughts while praying
The thoughts that cause the most shame are the ones about Allah Himself, or filthy and shameful images that arrive in the middle of sujood. They feel like the worst possible thoughts to have in the best possible place — and that is exactly why they hurt so much. But a thought you hate is not a belief, and it is not an act. The Prophet said: 'Allah has forgiven my followers the evil thoughts that occur to their minds, as long as such thoughts are not put into action or uttered' (Sahih al-Bukhari 5269). You did not choose the thought, you did not speak it, and you did not act on it — so it is forgiven, and your prayer stands.
Do not make the mistake of trying to push the thought away by force, because the harder you push, the more your mind holds on to it. The remedy is the one above: seek refuge, the light spitting, and then gently return your attention to the words you are reciting. The thought will fade when it stops being fought over — like a shout in an empty room, it dies when no one answers it.
- A thought you hate is not a belief and not an act — and it is forgiven (Sahih al-Bukhari 5269)
- You did not choose it, speak it, or act on it — so your prayer stands
- Do not try to force the thought away — the harder you push, the more your mind holds on
- Seek refuge, then gently return to the words you are reciting; the thought fades when no one answers it
Do not restart the prayer because of a thought
This is the rule that saves more people than any other in this cluster, so hear it clearly: you do not restart your prayer because of a bad thought. Restarting feels like purification — 'I will pray a clean prayer this time' — but it teaches your heart the opposite lesson: that the thought had the power to ruin your worship. The next prayer, the thought returns, and you restart again. Within weeks, a person can be praying the same prayer three or four times and still never feeling it was valid. That is waswasah winning.
Your prayer is valid even with the wandering and the whispers in it, as long as you performed its pillars and its conditions. The Prophet himself forgot in prayer — he prayed five rak'ahs once, and when the companions told him, he did the two prostrations of forgetfulness and finished (Sahih Muslim 572a and related narrations). If forgetfulness in the prayer of the Prophet did not ruin it, a whisper in yours does not ruin it either. Finish the prayer, do the prostrations of forgetfulness if you genuinely lost count, and move on.
- Never restart your prayer because of a bad thought — restarting teaches your heart the whisper has power
- A prayer with whispers in it is still valid if its pillars and conditions were performed
- The Prophet himself forgot in prayer and completed it with the prostrations of forgetfulness (Sahih Muslim 572a)
- Finish the prayer and move on — that is how the cycle is broken
How to bring your heart back
A wandering mind in prayer is normal — the task is not to have a perfectly still mind, but to keep bringing it back gently. Three habits help more than any other. First, slow down: recite slowly enough to hear your own words, pause briefly between verses, and let each movement of the prayer have its own moment instead of rushing through them. Second, understand what you are saying: learn the meaning of Al-Fatiha and the short surahs, so the words hold meaning instead of empty sound. When you understand 'You alone we worship, and You alone we ask for help', the words carry your heart with them.
Third, prepare before the prayer rather than fighting during it. A brief pause before you say 'Allahu Akbar', in which you remind yourself who you are standing before, does more than any struggle mid-prayer. The Prophet's companions took their distractions to him and asked for help — and you can take yours to a qualified teacher, who can help you learn the meanings and build a calm prayer routine one step at a time.
- Slow down — recite slowly enough to hear your own words, and give each movement its own moment
- Learn the meanings of Al-Fatiha and the short surahs, so the words carry your heart
- Pause briefly before 'Allahu Akbar' and remind yourself who you are standing before
- Take your distractions to a qualified teacher, as the companions took theirs to the Prophet
When distraction becomes distress
There is normal distraction — the mind drifts to the day's worries and comes back — and there is something heavier: every prayer filled with tormenting thoughts, hours spent redoing prayers, avoiding salah altogether because of what comes with it, or a distress that grows week by week. If you recognise the heavier pattern, do not carry it alone. The steps in this guide still apply — they are the daily practice — but they need to be joined by a conversation with a qualified scholar about your prayers and a mental-health professional about the distress itself.
Until then, keep praying. The whisper wants most of all to push you away from prayer itself, and the greatest victory over it is to keep standing in salah even while it whispers. Allah says: 'Verily, in the remembrance of Allah do hearts find rest' (Quran 13:28) — and prayer is the greatest of remembrance. The rest does not always come in the first prayer, or the tenth — but it comes to the one who keeps returning.
- Normal distraction drifts and returns — distress that fills every prayer needs more help
- If you avoid salah, redo prayers for hours, or distress keeps growing, speak to a scholar and a professional
- Keep praying — the whisper's greatest goal is to push you away from salah itself
- In the remembrance of Allah do hearts find rest (Quran 13:28) — and prayer is the greatest remembrance
Frequently asked questions
Does a bad thought during salah break my prayer?+
No. An unwanted thought does not break your prayer, and you do not need to restart it. Unwanted thoughts are forgiven unless acted on or spoken (Sahih al-Bukhari 5269). Seek refuge with Allah, and if the whisper is confusing your recitation, give a light dry spit to your left three times as the Prophet taught (Sahih Muslim 2203a), then carry on.
Should I restart my prayer if a shameful thought came in sujood?+
No. Restarting because of a thought teaches your heart that the whisper has the power to ruin your worship, and the cycle then repeats in the next prayer. Finish the prayer you are in. Only a genuine mistake in the prayer itself — like losing count of rak'ahs — needs the two prostrations of forgetfulness (Sahih Muslim 571a).
Is it hypocrisy to have bad thoughts while praying?+
No. Hypocrisy is pretending to believe while disbelieving in the heart. You are distressed by the thoughts precisely because you believe — and the Prophet called that distress clear faith (Sahih Muslim 132a). A hypocrite would not be horrified by their own thoughts; you are.
What if I cannot concentrate in prayer at all?+
Slow down, learn the meanings of what you recite, and pause briefly before you begin. Full, unbroken concentration is rare even for people of great worship — the task is to keep gently bringing your heart back. If the lack of concentration comes with tormenting thoughts in every prayer, speak to a qualified scholar and a mental-health professional as well.
Can I seek refuge and spit in the middle of congregational prayer?+
Yes — do it quietly and discreetly so you do not disturb the person beside you. The light spitting is a small puff of breath to your left, not real spitting. If it is not possible to do it discreetly, seeking refuge alone in your heart and carrying on is enough.