There is a graveyard adjacent to a mosque, where there are visible signs of there being graves present. Now, the people want to demolish the graves and build a warehouse/cellar and build a mosque on top; is this permissible? People who deem such an act as permissible use evidence from the Ahadith in which the Messenger ﷺ commanded Sayyidunah Ali not to leave any idol but to destroy it and not to leave any grave but to demolish it, and another narration in which the graves were exhumed.
Such an act is strictly unlawful and in fact Haram. The first unlawful act is disregard for the Muslims’ graves. Secondly, performing Salah on graves and thirdly, changing the conditions of Waqf unlawfully and without any authority. What has been mentioned in the Ahadith is to shorten graves that are excessively higher than the limit set by the Sacred Law. How can destroying the graves of the Muslims, to walk on them, to cause pain to the deceased, to perform Salah on them take the same ruling as exhuming the graves of the polytheists?
And Allah ﷻ knows the best
Imam Ahmad Rida Khan رحمة الله تعالى عليه
Translation by Dr Musharraf Hussain Al-Azhari Translator of Majestic Quran, www.majesticquran.co.uk