Actions are but by intentions, and every person will have only what he intended.
“Actions are but by intentions, and every person will have only what he intended.”
The Prophet (may Allah's peace and blessings be upon him) explains that all deeds are considered according to the intention behind them. This ruling generally applies to all deeds, including acts of worship and dealings. So, he who seeks by his deed some worldly benefit will attain that benefit and will not be rewarded for it.
The plain meaning, from HadeethEnc
عَنْ أَمِيرِ المُؤْمِنِينَ أَبِي حَفْصٍ عُمَرَ بْنِ الخَطَّابِ رضي الله عنه قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: «إنَّمَا الأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إلَى اللَّهِ وَرَسُولِهِ فَهِجْرَتُهُ إلَى اللَّهِ وَرَسُولِهِ، وَمَنْ كَانَتْ هِجْرَتُهُ لِدُنْيَا يُصِيبُهَا أَوْ امْرَأَةٍ يَنْكِحُهَا فَهِجْرَتُهُ إلَى مَا هَاجَرَ إلَيْهِ».
The Commander of the Believers, Abu Hafs ‘Umar ibn al-Khattāb (may Allah be pleased with him) reported: I heard the Messenger of Allah (ﷺ) say: "Verily, the reward of deeds depends on intentions, and each person will be rewarded according to what he intended. So, he whose emigration is for the sake of Allah and His Messenger, his emigration will be for the sake of Allah and His Messenger, and he whose emigration is to achieve some worldly gain or take some woman in marriage, his migration will be for what he has migrated for."
What does Sahih al-Bukhari 1 mean?
This is the first hadith in Sahih al-Bukhari, narrated by ‘Umar ibn al-Khattab, and it is agreed upon. The example the Prophet (peace be upon him) gave is what makes it concrete: two men make the same emigration, one for Allah and one for a worldly gain or a woman he wished to marry, and each gets exactly what he set out for. The scholars extend it in both directions — an ordinary act done for Allah is rewarded, and a religious act done for something else is not.
Written from HadeethEnc