Is Posting Acts of Worship on Social Media Considered Riya? Here is the Answer

A Muslim posts a status: “Alhamdulillah, just finished Tahajjud prayer. Hope to remain istiqamah.” In the comments section, praise flows. In another corner, a Muslimah uploads a photo of a suhoor dining table complete with a morning prayer caption.

Is this riya? Or dawah? Or something in between?

This is not a new question. However, in the era of social media, its frequency has sharply increased. This article addresses it directly, based on the book Dalīl al-Fāliḥīn Syarḥ Riyāḍ al-Ṣāliḥīn by Muḥammad ʿAlī ibn ʿAllān al-Ṣiddīqī, from the perspective of the Shafi’i Madhhab.

Table of Contents

What is Riya? The Definition from Scholars

To answer the question above, we must understand riya from its roots. The best way to understand riya is to understand its opposite: ikhlas (sincerity).

Definition of Ikhlas According to al-Qushayri — The Opposite of Riya

Al-Ustadz Abū al-Qāsim al-Qushayrī defines ikhlas with a very sharp statement:

الإخلاص إفراد الحقّ سبحانه وتعالى في الطاعات بالقصد، وهو أن يريد بطاعته التقرّب إلى الله تعالى دون شيء آخر من تصنع لمخلوق واكتساب محمدة عند الناس أو محبة مدح من الخلق أو معنى من المعاني سوى التقرّب إلى الله تعالى.

“Ikhlas is singling out Allah Subḥānahu wa Taʿālā in obedience with intention—that is, one desires through their obedience to draw near to Allah alone, without anything else: without feigning before creations, without seeking praise among people, without loving the flattery of others, and without any motive other than seeking nearness (taqarrub) to Allah.”[1]

From this definition, riya is the exact opposite: when an action is still attached to creations—wanting to be seen, wanting to be praised, or wanting to be considered a good person by others.

Definition of Ikhlas According to ar-Raghib al-Ashfahani

Imam ar-Rāghib al-Aṣfahānī, in his book Mufradāt, provides a more concise yet profound definition:

الإخلاص التعرّي عما دون الله تعالى

“Ikhlas is detaching oneself from everything other than Allah Taʿālā.”[2]

This means that as long as the heart still turns toward anything other than Allah—including the gaze of people on social media—that is where the gap for riya opens.

Is Riya Considered Minor Shirk?

In the same book, Ibn ʿAllān explains the direct relationship between intention and its consequences:

ما قصده به من وجه الله سبحانه فيثاب أو الرياء للعباد فيمنع الثواب

“Whatever is intended for Allah Subḥānahu is rewarded. That which is due to riya toward the servants of Allah, its reward is withheld.”[3]

The question of whether riya is considered minor shirk (idolatry) has a strong foundation from the muttafaqun alaih hadith regarding the first three groups to be thrown into Hellfire on the Day of Judgment—including a person who fought in jihad to be called courageous and a person who studied to be called a scholar. This hadith is referenced more deeply in our content silo discussing what riya is and its types.

What is Sum’ah? Its Difference from Riya

Many people assume riya and sum’ah are the same thing. They are indeed related, but their methods differ.

Definition of Sum’ah and Its Difference from Riya

Ibn ʿAllān in Dalīl al-Fāliḥīn explains within the context of the hadith on jihad:

يقاتل رياءً أي ليرى الناس قتاله، ومثله القتال سُمْعةً أي ليسمع الناس

“(Someone) fights out of riya—meaning so that people see their combat. And similar to it is fighting out of sum’ah—meaning so that people hear (about their deeds).”[4]

From this, the difference is clear:

AspectRiyaSum’ah
MediumVisible appearance/actionsStories/news that are heard
MethodOthers witness directlyOthers hear the news
Modern ExamplePraying in a crowded place to be seenPosting on social media to be known

Mechanically, posting acts of worship on social media falls closer to the category of sum’ah—because the fundamental goal is to be “heard” and “known” by others through text, photos, or videos.

Is Sum’ah as Dangerous as Riya?

Yes. Both equally close the door to reward. The principle that applies is the statement from the hadith on intention:

وإنما لكل امرىء ما نوى

“And every person will only get (a reward corresponding to) what they intended.”[5]

If the intention is social recognition, then that is exactly what is attained—not the reward from Allah. See also the comprehensive discussion in the article about the differences between riya, sum’ah, and ujub (vanity).

Posting Acts of Worship on Social Media — Is it Considered Riya or Not?

Calligraphy of the hadith innamal a'malu binniyat regarding intention and sincerity in worship
“Verily, deeds are judged by their intentions.” — Narrated by Bukhari & Muslim

This is the core of the question. The answer cannot be black-and-white without looking at one thing: intention.

The Main Key: The Intention in the Heart

The hadith that serves as the foundation for the entire chapter on ikhlas in Riyadhus Shalihin is:

إنما الأعمال بالنيات

“Indeed, all actions are (judged) by their intentions.”[6]

The place of intention is in the heart, not in the written caption, nor in the hashtags used. The exact same content—a photo of a prayer mat, a status after praying, a live stream of Quran recitation—can either be rewarding dawah or sum’ah that nullifies the reward, depending entirely on the intention of the uploader.

The key question is not “what are you posting?” but rather: why are you posting it?

Three Possible Intentions When Posting Worship

Based on the principle of intention from the book Dalīl al-Fāliḥīn, there are three possible patterns of intention:

  1. Pure Dawah Intention: The content is created to invite others to worship, to inspire, and to spread goodness; not to show off oneself. This intention is pure and rewarding.
  2. Mixed Intention: There is an intention for dawah, but there is also a desire to be praised or recognized. This is the most common and requires the most caution. The reward exists, but it decreases according to the degree of the mixed intention.
  3. Pure Sum’ah/Riya Intention: The primary goal is to be considered pious, gain followers, or attain social recognition. Actions like this, as Ibn ʿAllān states, have their rewards withheld.

When Can Posting Worship Become Riya or Sum’ah?

Illustration of using social media for dawah purposes, not to show off personal worship
Dawah on social media can bring great rewards — if the intention is straight.

There are several signals to watch out for. This is not to judge others, but for self-reflection (muhasabah):

  • Feeling excessively happy when a worship post receives many likes or praising comments.
  • Feeling disappointed or anxious when worship content does not receive much response.
  • Only posting worship when there is a “show-off worthy” moment—while ordinary daily worship is never posted.
  • Captions that highlight oneself (“Alhamdulillah I managed to…”) rather than inviting others (“Let’s all…”).

The four signals above are not a verdict, but a mirror. Who knows the contents of our hearts better than Allah and ourselves?

Qur’anic Evidences on Allah Knowing the Contents of the Heart

Tafsir of Surah Ali ‘Imran: 29 — Allah Knows What is Hidden and Revealed

Ibn ʿAllān quotes this verse as a stern warning about riya:

قُلْ إِن تُخْفُوا مَا فِي صُدُورِكُمْ أَوْ تُبْدُوهُ يَعْلَمْهُ اللهُ

“Say: ‘Whether you conceal what is in your breasts or reveal it, Allah knows it.'”[7]

The lesson from this verse is highly relevant to the context of social media: Allah does not judge the post, but judges what is in the breast the moment the “upload” button is pressed.

Tafsir of Surah al-Bayyinah: 5 — The Command to Worship with Sincerity

وَمَا أُمِرُوا إِلَّا لِيَعْبُدُوا اللهَ مُخْلِصِينَ لَهُ الدِّينَ

“And they were not commanded except to worship Allah, being sincere to Him in religion.”[8]

Hafiz al-Suyuthi in al-Iklīl derives evidence from this verse that ikhlas is a condition for the validity of worship, because ikhlas cannot materialize without the correct intention.

Warning: Do Not Be Deceived by Hidden Riya

Ibn ʿAllān directly warns after quoting Surah Ali Imran: 29:

ولا يغترّ بخفائه ظاهراً فإن الله تعالى عالم بخفيات الأمور، لا تخفى عليه وساوس الصدور

“Let no one be deceived because it (riya) is outwardly hidden, for indeed, Allah Taʿālā is the Knower of hidden matters. The whispers of the breasts are not hidden from Him.”[9]

Meaning: riya that is unseen by humans remains visible to Allah. Nothing escapes just because the post looks “Islamic.”

The Ruling on Showcasing Charity — Is it Still Valid?

Public Charity in the Qur’an

Surah al-Ḥajj: 37 affirms the same principle in the context of sacrifice (qurbani):

لَن يَنَالَ اللهَ لُحُومُهَا وَلَا دِمَاؤُهَا وَلَٰكِن يَنَالُهُ التَّقْوَىٰ مِنكُمْ

“Their meat will not reach Allah, nor will their blood, but what reaches Him is piety from you.”[10]

Ibn ʿAbbās explains: this verse was revealed because the people of Jahiliyyah used to smear the Kaaba with the blood of sacrificial animals, and some Muslims wanted to follow suit. Allah affirmed: what reaches Him is not the outward physical form of the deed, but the piety behind it.

Showing charity is fundamentally permissible—even encouraged for zakat to motivate others to give. However, if the purpose shifts to showing off, the reward falls away.

The Story of Ma’n bin Yazid: Intentions in Charity That Miss the Target

The 8th hadith in the Chapter of Ikhlas (Riyadhus Shalihin) contains an apt story for this: Yazid bin Akhnas left charity at the mosque, and inadvertently, the charity was received by his own son, Ma’n. When Yazid found out, he said: “It was not for you that I intended this charity!” This story demonstrates how a specific and precise intention heavily determines the deed. Read the full discussion in the article on the hadith of Ma’n bin Yazid regarding charity.

Is it Permissible to Post Dawah Content Even if it Involves Being Known by Others?

The Difference Between Displaying Worship for Dawah vs. for Praise

Infographic showing the difference between riya, sum'ah, and dawah intention in worship
The difference is subtle — but the consequences are vastly different in the sight of Allah.

Returning to the principle from Dalīl al-Fāliḥīn:

ما قصده به من وجه الله

“What is intended for the face (pleasure) of Allah.”

The benchmark is not on the content, but on the intention. Someone who posts worship content with the intention of inviting others to goodness differs fundamentally from a person whose goal is to be recognized as pious.

Worship that is seen by people does not automatically become riya. Ibn ʿAllān even explains in another context that outward deeds remain rewarding even if witnessed by people—as long as the inner intention remains straight toward Allah.

What if the Intention is Mixed Between Dawah and Wanting to be Known?

Mixed intentions (mukhtaliṭah) are acknowledged by scholars as a common reality. The principle from the discussion of the arbāb al-ishārāt in Dalīl al-Fāliḥīn provides a tiered guideline:

ونية أهل النفاق التزين عند الله وعند الناس

“The intention of the hypocrites is to adorn themselves before Allah and before people simultaneously.”[11]

This sentence is a warning that a truly pure intention does not seek to look good in two courts simultaneously. What determines the outcome is which intention is more dominant. If the dawah intention is stronger, the deed is not nullified—but the mixture of sum’ah intention still reduces the quality of the reward.

Tips for Guarding Intentions Before and After Posting

An illustration of the process of planning responsible dawah content and safeguarding one's intentions.
Before posting, ask yourself first: for whom is this made?

Based on the principle of ikhlas from Dalīl al-Fāliḥīn, there are four questions that can serve as practical guidelines:

  1. Before posting: “Would I still perform this act of worship if no one knew I was posting it?”
  2. After posting: “Do I feel disappointed when this content gets few likes?”
  3. When writing a caption: “Does this caption invite others, or does it highlight myself?”
  4. Overall: “Have I increased my sirriyyah (hidden) deeds as a counterbalance?”

Explanations from Sufi Scholars on Intentions and Outward Actions

Levels of Intention According to Sufi Scholars

Dalīl al-Fāliḥīn quotes the explanation of the arbāb al-ishārāt (masters of spiritual signs from among the Sufis) regarding the levels of intention:

فنية العوام في طلب الأعراض مع نسيان الفضل، ونية الجهال التحصن عن سوء القضاء ونزول البلاء، ونية أهل النفاق التزين عند الله وعند الناس، ونية العلماء إقامة الطاعات لحرمة ناصبها لا لحرمتها، ونية أهل التصوّف ترك الاعتماد على ما يظهر منهم من الطاعات

“The intention of the laypeople is seeking worldly gains while forgetting the virtue (of the Hereafter). The intention of the ignorant is seeking protection from bad decrees and the descent of calamities. The intention of the hypocrites is adorning themselves before Allah and before people simultaneously. The intention of the scholars is establishing obedience out of reverence for the One who mandated it (Allah), not out of reverence for the obedience itself. The intention of the Sufis is abandoning reliance on the outward appearance of the acts of obedience that manifest from them.”[12]

These five levels serve as a mirror. Where does our intention stand when posting?

Visible Worship is Not Automatically Riya

This point is often overlooked: deeds that are seen do not instantly become riya. What determines it is what is inside the heart.

Ibn ʿAllān explains, within the context of the hadith that Allah looks at the heart—not the appearance—that “The granting of reward and nearness to Allah is not based on outward actions, but rather on what is in the heart.”[13]

Praying in the mosque, reading the Qur’an in front of people, or even live streaming recitation—none of these are automatically void just because people are watching. What nullifies the reward is if the heart competes to seek praise from the audience, rather than from Allah.

How to Purify Intentions from Riya and Sum’ah

Self-Reflection Before Posting — Questions for Oneself

Ibn ʿAllān emphasizes the importance of heart muhasabah (self-reflection):

تصحيح مقاصده وعزومه، وتطهيره عن كل وصف مذموم

“Correcting one’s objectives and resolves, and purifying it from every blameworthy trait.”[14]

Practically, before posting anything related to worship, ask yourself:

  • Would this content exist if no one was watching?
  • Who do I hope reads this—Allah, or humans?
  • Would I still be satisfied even if there is not a single praising comment?

Secret Deeds (Amalan Sirriyyah) as a Cure for Riya

One of the most potent antidotes for riya is to increase amalan sirriyyah—hidden deeds known to no one except Allah. The hadith about the charity given by the right hand that is hidden from the left hand is the best illustration of this.

Secret deeds do not mean it is forbidden to do good openly. However, the presence of hidden deeds in a person’s life is a sign that they do not worship solely for an audience.

Supplication to be Protected from Riya

The Prophet ﷺ taught a specific supplication to be kept away from riya:

اَللَّهُمَّ إِنِّي أَعُوذُ بِكَ أَنْ أُشْرِكَ بِكَ شَيْئًا أَعْلَمُهُ، وَأَسْتَغْفِرُكَ لِمَا لَا أَعْلَمُهُ

Allāhumma innī a‘ūdhu bika an ushrika bika shay’an a‘lamuhu, wa astaghfiruka limā lā a‘lamuhu.

“O Allah, I seek refuge in You from knowingly associating anything with You, and I seek Your forgiveness for what I do not know.”

This prayer also covers hidden riya and sum’ah, which we sometimes do not realize ourselves.


FAQ: Questions Regarding Posting Worship on Social Media and Riya

Is Posting Photos of Charity on Social Media Considered Riya?

Not automatically. Displaying charity is fundamentally permissible, and even recommended for zakat. But if the primary intention of posting a charity photo is to be praised or considered generous—that is the sum’ah that closes the door to reward. The key remains the intention in the heart.

Is it Permissible to Post a “Just Finished Tahajjud” Status?

It is permissible if the intention is to inspire others or as a self-reminder. But it needs to be evaluated: would that status still be written even if not a single person would read it? If the answer is no, then the intention needs to be re-examined.

Does a Live Stream While Reciting the Quran Count as Sum’ah?

Not necessarily. Live streaming recitation can be a highly rewarding dawah if the intention is to spread knowledge and invite others to learn. Sum’ah occurs when the goal shifts to being called an “ustadz,” a “pious person,” or to gain followers. The benchmark: is the content made because others do not know about this worship, or because one wants others to know that I am worshipping?

What if the Initial Intention is Sincere, but Then One Feels Proud Due to Praise?

Scholars differentiate between feeling happy after being praised and posting because one wants to be praised. If the initial intention was sincere, and then upon receiving praise a feeling of joy emerges—that is not automatically riya. As long as that joy does not change the motivation for future worship, it is considered permissible glad tidings. What is dangerous is when the desire for praise becomes the reason for doing the deed.

Does Riya Nullify the Worship or Only Reduce its Reward?

From the principles explained in Dalīl al-Fāliḥīn, riya withholds the reward—it does not always nullify the fiqh validity of the worship. A prayer performed with riya still fulfills the obligation (from a fiqh perspective), but its reward does not reach Allah. This distinction is important: the worship is legally valid, but spiritually unrewarded. For a deeper discussion, see the article on how to avoid riya in daily worship.


Islam does not absolutely forbid displaying worship. The Qur’an itself states that disclosing charity is sometimes better (QS. al-Baqarah: 271). Congregational prayer in the mosque is visible worship. Public knowledge circles are audible worship.

The problem lies not in the outward display, but in the intention behind it. And that intention is only known to two parties: Allah and oneself.

Before opening a social media app to post something about worship, take a moment to ask your heart. That is muhasabah. And multiply the secret deeds that no one knows about—as a safeguard so the heart does not rely too heavily on the eyes of humans.

For a more complete understanding of intention and ikhlas in Islam, visit our pillar article. And to understand deeper the 12 hadiths on ikhlas in Riyadhus Shalihin, a full review based on the commentary of Dalīl al-Fāliḥīn is available.

⚠️ Disclaimer: This discussion refers to the perspective of the Shafi’i Madhhab and the book Dalīl al-Fāliḥīn Syarḥ Riyāḍ al-Ṣāliḥīn by Ibn ʿAllān al-Ṣiddīqī. For personal fatwas, please consult with trusted scholars or fatwa institutions.

Footnotes:

1 : Muḥammad ʿAlī ibn ʿAllān al-Ṣiddīqī al-Bakrī al-Shāfiʿī, Dalīl al-Fāliḥīn li-Ṭuruq Riyāḍ al-Ṣāliḥīn, ed. Khalīl Maʾmūn Shīḥā, 4th ed., 8 vols. (Beirut: Dār al-Maʿrifah li-l-Ṭibāʿah wa-l-Nashr wa-l-Tawzīʿ, 1425/2004), Vol 1, p. 49. (Quote from al-Qushayrī.)

2 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 49. (Quote from al-Rāghib al-Aṣfahānī, Mufradāt Alfāẓ al-Qurʾān.)

3 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 54.

4 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 75.

5 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 53–54. (Latter part of the hadith on intention narrated by ʿUmar bin al-Khaṭṭāb, muttafaqun ʿalaih.)

6 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 51–52. (Initial part of the hadith on intention narrated by ʿUmar bin al-Khaṭṭāb, muttafaqun ʿalaih.)

7 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 51. (QS. Āl ʿImrān: 29.)

8 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 50. (QS. al-Bayyinah: 5.)

9 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 51.

10 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 50-51. (QS. al-Ḥajj: 37.)

11 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 56–57. (Quote from the arbāb al-ishārāt cited by al-Kāzarūnī in Syarḥ al-Arbaʿīn.)

12 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 56–57.

13 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 72–73.

14 : Ibn ʿAllān, Dalīl al-Fāliḥīn, Vol 1, p. 72–73.

Muḥammad ʿAlī ibn ʿAllān al-Ṣiddīqī al-Bakrī al-Shāfiʿī, Dalīl al-Fāliḥīn li-Ṭuruq Riyāḍ al-Ṣāliḥīn, ed. Khalīl Maʾmūn Shīḥā, 4th ed., 8 vols. (Beirut: Dār al-Maʿrifah li-l-Ṭibāʿah wa-l-Nashr wa-l-Tawzīʿ, 1425/2004), Vol 1, p. 49-75.

Discussion Room

Please feel free to ask or share knowledge with good adab. Your email address is safe and will not be published.