Sayyiduna Abu Marthad Ghanawi (may Allah be pleased with him) says that I heard the Messenger of Allah (peace and blessings be upon him) say: Do not pray towards graves and do not sit on them. And in another narration, the words are: Do not sit on graves and do not pray on them.
Hadith Referenceالفتح الربانی / أبواب المساجد / 1420
Hadith Gradingمحدثین:صحیح
Hadith Takhrij«أخرجه مسلم: 972 ، (انظر مسند أحمد ترقيم الرسالة: 17216)۔ ترقیم بيت الأفكار الدولية: 17348»
Brief Explanation
Benefits: … The summary of these narrations is that one should neither sit upon the grave, nor perform prayer on it or facing towards it.