Abu Sa'id reported God’s Messenger as saying, “The whole earth is a mosque, with the exception of a graveyard and a bath.”
Abu Dawud, Tirmidhi and Darimi transmitted it.
Ibn ‘Umar said that there were seven places in which God’s Messenger forbade people to pray: a dunghill, a slaughterhouse, a graveyard, the middle of the road, a bath, places where camels kneel to drink, and on the roof…
Ibn ‘Abbas said that God’s Messenger cursed women who visited graves, people who put mosques there and those who lit lamps there.
Abu Dawud, Tirmidhi and Nasa’i transmitted it.
Abu Umama said that a Jewish doctor asked the Prophet (ﷺ) what places were best, but he did not answer his question, saying, “I shall say nothing till Gabriel comes.” So he remained silent, and when Gabriel came he asked…