structural:reformatting
Modern era

Opposition to Sufi teachers and orders from more literalist and legalist strains of Islam existed in various forms throughout Islamic history. It took on a particularly violent form in the 18th century with the emergence of the Wahhabi movement.

Around the turn of the 20th century, Sufi rituals and doctrines also came under sustained criticism from modernist Islamic reformers, liberal nationalists, and, some decades later, socialist movements in the Muslim world. Sufi orders were accused of fostering popular superstitions, resisting modern intellectual attitudes, and standing in the way of progressive reforms. Ideological attacks on Sufism were reinforced by agrarian and educational reforms, as well as new forms of taxation, which were instituted by Westernizing national governments, undermining the economic foundations of Sufi orders. The extent to which Sufi orders declined in the first half of the 20th century varied from country to country, but by the middle of the century the very survival of the orders and traditional Sufi lifestyle appeared doubtful to many observers.

However, defying these predictions, Sufism and Sufi orders have continued to play a major role in the Muslim world, also expanding into Muslim-minority countries. Its ability to articulate an inclusive Islamic identity with greater emphasis on personal and small-group piety has made Sufism especially well-suited for contexts characterized by religious pluralism and secularist perspectives.

In the modern world, the classical interpretation of Sunni orthodoxy, which sees in Sufism an essential dimension of Islam alongside the disciplines of jurisprudence and theology, is represented by institutions such as Egypt 's Al-Azhar University and Zaytuna College, with Al-Azhar's current Grand Imam Ahmed el-Tayeb recently defining "Sunni orthodoxy" as being a follower "of any of the four schools of thought (Hanafi, Shafi’i, Maliki or Hanbali) and... of the Sufism of Imam Junayd of Baghdad in doctrines, manners and purification."

Current Sufi orders include Madariyya Order, Alians, Bektashi Order, Mevlevi Order, Ba 'Alawiyya, Chishti Order, Jerrahi, Naqshbandi, Mujaddidi, Ni'matullāhī, Qadiriyya, Qalandariyya, Sarwari Qadiriyya, Shadhiliyya, Suhrawardiyya, Saifiah (Naqshbandiah), and Uwaisi.

The relationship of Sufi orders to modern societies is usually defined by their relationship to governments.

Turkey, Persia and The Indian Subcontinent have all been a center for many Sufi lineages and orders. The Bektashi were closely affiliated with the Ottoman Janissaries and are the heart of Turkey's large and mostly liberal Alevi population. They have spread westwards to Cyprus, Greece, Albania, Bulgaria, North Macedonia, Bosnia and Herzegovina, Kosovo, and, more recently, to the United States, via Albania. Sufism is popular in such African countries as Egypt, Tunisia, Algeria, Sudan, Morocco, and Senegal, where it is seen as a mystical expression of Islam. Sufism is traditional in Morocco, but has seen a growing revival with the renewal of Sufism under contemporary spiritual teachers such as Hamza al Qadiri al Boutchichi. Mbacke suggests that one reason Sufism has taken hold in Senegal is because it can accommodate local beliefs and customs, which tend toward the mystical.

The life of the Algerian Sufi master Abdelkader El Djezairi is instructive in this regard. Notable as well are the lives of Amadou Bamba and El Hadj Umar Tall in West Africa, and Sheikh Mansur and Imam Shamil in the Caucasus. In the twentieth century, some Muslims have called Sufism a superstitious religion which holds back Islamic achievement in the fields of science and technology.

A number of Westerners have embarked with varying degrees of success on the path of Sufism. One of the first to return to Europe as an official representative of a Sufi order, and with the specific purpose to spread Sufism in Western Europe, was the Swedish -born wandering Sufi Ivan Aguéli. René Guénon, the French scholar, became a Sufi in the early twentieth century and was known as Sheikh Abdul Wahid Yahya. His manifold writings defined the practice of Sufism as the essence of Islam, but also pointed to the universality of its message. Spiritualists, such as George Gurdjieff, may or may not conform to the tenets of Sufism as understood by orthodox Muslims.