As Shaykh al-Islam states in al-Fatāwā (2/186):
Great trials befell him, may Allah have mercy on him, because he issued the fatwa that it is impermissible to saddle mounts for the purpose of visiting the graves of prophets and righteous people—even the grave of our Prophet Muhammad ﷺ. His writings overflow with proofs for the view he espoused.
Imam al-Subkī—one of his contemporaries—replied to him, authoring a work entitled Shifāʾ al-Siqām fī Ziyārat Khayr al-Anām. In it he cited the hadiths that speak of visiting the Prophet’s grave and the statements of the scholars regarding its lawfulness. Yet he stumbled gravely when he attributed to Shaykh al-Islam the position of denying the visitation of the Prophet altogether—that is, even without undertaking a journey—whereas Shaykh al-Islam is in fact among those who affirm the visit, mention its virtues, and lay out its etiquettes, as he states in several of his books.
Accordingly, the distinguished scholar and ḥadith-master Abū ʿAbd Allāh Muḥammad ibn ʿAbd al-Hādī produced an extensive refutation of al-Subkī titled al-Ṣārim al-Munkī fī al-Radd ʿalā al-Subkī. It is a valuable work, rich in legal, hadith, and historical material. He examines at length the cited narrations, exposing the weakness and fabrication among them, and he vindicates Ibn Taymiyya from the denial ascribed to him by quoting numerous passages from his own writings. Whoever wishes may consult that book.
It is astonishing that this erroneous attribution to Ibn Taymiyya gained currency among many scholars and shaykhs who came after him. The last of them, Allah willing, was Shaykh Yūsuf al-Nabhānī, who filled many pages with ignorant attacks on Ibn Taymiyya.