All of these reports are sound and well–established according to the scholars of the Prophet’s hadith. Supplication and seeking forgiveness reach the deceased at his grave, and that is how a Muslim should treat the dead among the believers—offering every kind of prayer for them, just as he prayed for them during their lives.
The Messenger of Allah ﷺ instructed us to invoke blessings and peace upon him during his life and after his death, and upon the members of his household. He also commanded us to pray for all believing men and women, in life and in death, whether we are at their graves or far from them.
Allah has forbidden us to set up partners alongside Him or to liken the dwelling of a created being—namely, his grave—to the House of Allah, which is the Kaʿbah, the Sacred House. Allah has enjoined us to make pilgrimage to it, to face it in prayer, to circumambulate it, and He has legislated that we touch its corners and kiss the Black Stone, which He has placed in the position of His right hand. Ibn ʿAbbās said, “The Black Stone is Allah’s right hand on earth; whoever touches it and shakes hands with it is as though he has shaken hands with Allah and kissed His right hand.”
He has also prescribed that the Kaʿbah be clothed and draped with hangings, and those seeking refuge would grasp its curtains as one clings to the hem of his protector. Therefore, it is impermissible to equate the houses of created beings with the House of the Creator.
For this reason the early generations forbade anyone visiting the Prophet’s grave ﷺ to kiss it; rather, he should greet him—may my father and mother be sacrificed for him—and send blessings upon him, just as the first Muslims used to do.
If those predecessors—who were better acquainted with the religion of Allah, the Sunnah of His Prophet, His rights, and the rights of the earliest and the later generations from the Prophet’s family and others—never practiced any of these innovations that resemble