Hadith on Intention: Deeds only rewarded by their intentions

Umar ibn al-Khattab reported: The Messenger of Allah, peace and blessings be upon him, said, “Verily, deeds are only with intentions. Verily, every person will have only what they intended. Whoever emigrated to Allah and his messenger, his emigration is for Allah and his messenger. Whoever emigrated to get something in the world or to marry a woman, his emigration is for that to which he emigrated.”

Source: Ṣaḥīḥ al-Bukhārī 54, Ṣaḥīḥ Muslim 1907

Grade: Muttafaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim

عَنْ عُمَرَ بْنِ الْخَطَّابِ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِنَّمَا الْأَعْمَالُ بِالنِّيَّةِ وَإِنَّمَا لِامْرِئٍ مَا نَوَى فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ فَهِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ وَمَنْ كَانَتْ هِجْرَتُهُ لِدُنْيَا يُصِيبُهَا أَوْ امْرَأَةٍ يَتَزَوَّجُهَا فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ

54 صحيح البخاري كتاب الإيمان باب ما جاء إن الأعمال بالنية والحسبة ولكل امرئ ما نوى

1907 صحيح مسلم كتاب الإمارة باب قوله صلى الله عليه وسلم إنما الأعمال بالنية وأنه يدخل فيه الغزو وغيره من الأعمال