The Messenger of Allah ﷺ said, "A prayer in my mosque is better than a thousand prayers anywhere else except the Sacred Mosque, and a prayer in the Sacred Mosque is better than a hundred thousand prayers anywhere else."
أن رسول الله ﷺ قال: صلاة في مسجدي أفضل من ألف صلاة فيما سواه إلا المسجد الحرام، وصلاة في المسجد الحرام أفضل من مائة ألف صلاة فيما سواه.
Ibn Majah (1406) narrated it from Ismail bin Asad, who said, Zakariya bin Adi told us, saying, Ubaydullah bin Amr informed us, from Abdul-Kareem, from Ata, from Jabir, and he related it. Its chain of transmission is sahih. Ismail bin Asad is Ismail bin Abu Harith Asad bin Shahin Baghdadi, whom Abu Hatim, Daraqutni, Ibn Hibban and others deemed reliable. He was criticized without any supporting evidence. Imam Ahmad (14694) corroborated this, narrating it through Husayn bin Muhammad and Abdul-Jabbar bin Muhammad Khattabi, both of them from Ubaydullah bin Amr, with the same wording.Ubaydullah bin Amr is Ibn Abu Walid Raqqi, one of the narrators accepted by the community. Abdul-Kareem is Ibn Malik Jazari. Busiri said in Zawaid bin Majah, its chain of transmission is sahih. Ibn Hajar said in Fath al-Bari (3/67), "The men of its chain of transmission are reliable."It will also come by another route through Ata bin Abu Rabah, from Abdullah bin Zubayr, and it is possible that Ata received it from both of them together. Ibn Hajar said, "This is supported by the fact that Ata is an imam with a wide scope of narration, known for narrating from both Jabir and Ibn Zubayr."