Championing of Sunnism
Although al-Qadir held no temporal political power, he nevertheless managed to exploit the opportunities he was presented with to greatly restore the moral and religious authority of the caliphate. In this, he made good use of his own education in Islamic jurisprudence (fiqh), which gave him an authority to speak as a member of the emerging class of religious scholars (ʿulamāʾ). The Abbasids had traditionally been followers of the Hanafi school of jurisprudence, but this association was broken in the Buyid period, in favour of the Shafi'i school. The Shafi'is were supported by the Buyids, in large part due to the convergence between Shafi'i and Shi'a doctrines. As a young prince, al-Qadir was thus taught by the Shafi'i scholar Ahmad ibn Muhammad al-Harawi, and his credentials in fiqh were enough for the 14th-century Shafi'i scholar Taqi al-Din al-Subki to count among the prominent scholars belonging to his school. As caliph, however, al-Qadir was to hew closer to the doctrines of the conservative traditionalist Hanbali school.
The first major clash with the Buyids over religious issues came with the appointment by Baha al-Dawla of the prominent pro-Shi'a Alid and dean of the Alids (naqīb al-ashrāf), Abu Ahmad al-Husayn ibn Musa, as the chief qāḍī (judge) at Baghdad in 1003/4. Seeing in this an attempt to impose Twelver jurisprudence against Sunni practices, al-Qadir put himself at the head of a popular Sunni reaction, and succeeded in reverting the nomination. From this point on, the caliph identified himself with a broad Sunni backlash against the Shi'a, both of the Twelver variant espoused by the Buyids, as well as the Isma'ili branch that was led by the rival Fatimid Caliphate. In this cause he succeeded in restoring the Sunni and Abbasid form of the khuṭba in Yamamah and Bahrayn. In 1006, a violent controversy broke out over a recension (muṣḥaf) of the Quran claimed to have belonged to Ibn Mas'ud, which was espoused by Shi'a scholars against the canonical version, but firmly rejected by the Sunnis. Al-Qadir summoned a commission of scholars that condemned the recension in April 1006, and ordered the execution of a Shi'a partisan who anathematized those who burned it. It was only the intervention of Baha al-Dawla that calmed matters and prevented the disorders from spreading. To further lend authority to the canonical version of the Quran, in 1010 al-Qadir assisted at public readings from it during the Friday prayers, wearing the Mantle of Muhammad.
The affair had also highlighted another threat, namely the inroads of Fatimid propaganda in Baghdad, where the name of the Fatimid caliph, al-Hakim bi-Amr Allah (r. 996–1021) was hailed during the riots over Ibn Mas'ud's recension. This was a development that threatened the Sunni Abbasids and the Twelver Buyids alike. The Fatimid threat became especially apparent in August 1010, when Qirwash ibn al-Muqallad, the Uqaylid emir of Upper Mesopotamia, whose power stretched to the outskirts of Baghdad, recognized the suzerainty of the Fatimid caliph. Al-Qadir responded by sending an embassy to Baha al-Dawla that succeeded in getting the Buyid ruler to apply pressure on the Uqaylid emir, who soon returned to Abbasid allegiance. The Emirs of Mecca also recognized Fatimid suzerainty, and for many years, Hajj pilgrims from Iraq were unable to visit the city as the security of their passage could not be guaranteed. Al-Qadir tried to secure the protection of the pilgrim caravans from being attacked and extorted by Bedouin tribes by giving rule over the Yamamah in central Arabia to the Bedouin chieftain Usayfir, but this had little success. Throughout the period, the safe passage of the caravans had to be purchased, often with donations provided by Islamic princes such as Mahmud of Ghazni for the purpose. Al-Qadir also tried to make the Emir of Mecca, Abu'l-Futuh, abandon the Fatimids and return to Abbasid allegiance, but without success.
As a further reaction against the Fatimids, in November 1011 al-Qadir issued the Baghdad Manifesto, signed by both Sunni and Twelver scholars. The document not only condemned the Fatimid Isma'ili doctrine as false, but denounced the Fatimid dynasty's claims to descent from Ali as fraudulent, and their followers as enemies of Islam. Singling out the Fatimids as the first target of his active involvement in public affairs was a clever move, as the Buyids not only tolerated it but regarded it as useful for their own purposes, and an attack on the rival Shi'a sect gathered support even from Twelver notables. This also left room for the Twelvers to reach an accommodation with the Abbasid caliphate; stories circulated that Ali himself, the fourth caliph and first Shi'a imam, had appeared in a dream prophesying his ascent to the throne. Twelver Alids continued to play an important role in Baghdad and Iraqi politics of the time, most prominently the brothers al-Sharif al-Radi and al-Sharif al-Murtada, sons of Abu Ahmad al-Husayn, who maintained close relations with the caliphal court and succeeded their father as naqīb al-ashrāf.
Al-Qadir's next target was the rationalist Mu'tazilite school, which had enjoyed the protection of the Buyids and whose members had often held the post of chief qāḍī in Baghdad under Buyid rule. Mu'tazilism had in the past been supported by Abbasid caliphs, most notably al-Ma'mun (r. 813–833), who even instituted the Inquisition-like mihna to persecute the traditionalists who refused to accept the Mu'tazilite doctrine of Quranic createdness. In the event, the persecution not only failed, but backfired: the mihna was suspended, and the traditionalist Hanbali school emerged with its prestige strengthened and its doctrines more influential than before. In 1017, al-Qadir unequivocally sided with his predecessors' opponents: he condemned Mu'tazilite as well as Shi'a doctrines, prohibited the teaching of Mu'tazilite doctrines or theological debate (kalām), and ordered those Hanafi jurists who had shown Mu'tazilite tendencies to do penance, on pain of corporal punishment and exile. Shortly after, on 27 January 1019, inspired by Hanbali ideas, the caliph issued a decree, the Risāla al-Qādiriyya ('Epistle of al-Qadir'), which for the first time explicitly formulated Sunni doctrine. The decree condemned Shi'a, Mu'tazilite, and even Asharite doctrines, and affirmed the veneration of the first four caliphs (the 'Rashidun') and of the Companions of Muhammad, as an obligation for all Muslims, against Shi'a beliefs that the first three caliphs had been illegitimate, as they had deprived Ali (the fourth caliph) of his rightful inheritance. All speculative theological debate was prohibited, along with the denigration of any of the Companions or even examination of the disputes in which they had been involved, and which had given rise to the first schisms in Islam. Quranic createdness was again singled out as heresy, its supporters branded as infidels "whose blood may legitimately be shed".
In 1029, al-Qadir reiterated and reinforced his theological doctrines; In three sessions on 2 September, 2 October, and 11 November, each more lengthy and elaborate than the previous one and held before an assembly of Alids, jurists, and other notables, the caliph once again denounced Mu'tazilism, condemned the doctrine of Quranic createdness, and reaffirmed the special status of the Rashidun caliphs and the need of "enjoining good and forbidding wrong". This coincided with the campaigns of Mahmud of Ghazni against the Shi'a, the Buyids (Ray was captured in 1029 and Kirman attacked two years later), and the Ghaznavid expansion into India, but also with the presence of Jalal al-Dawla on the Buyid throne, who was dependent on the caliph's goodwill. Thus al-Qadir was able to secure the dismissal of pro-Alid preachers, and the protection by armed escort of Sunni ones that were threatened by Shi'a partisans.