In 710, while Wei Anshi served as chancellor, Emperor Zhongzong suddenly died—a death that traditional historians believed to be a poisoning carried out by Emperor Zhongzong's powerful wife
Empress Wei and daughter Li Guo'er the
Princess Anle, so that Empress Wei could eventually be emperor like Wu Zetian and Li Guo'er could become crown princess. For the time being, however, Emperor Zhongzong's son by a
concubine,
Li Chongmao the Prince of Wen, was made emperor (as Emperor Shang), with Empress Wei serving as empress dowager and regent. Less than a month later, a coup led by Emperor Zhongzong's sister
Princess Taiping and nephew
Li Longji the Prince of Linzi (Li Dan's son) killed Empress Wei and Li Guo'er. In short order, Emperor Shang was deposed, and Li Dan returned to the throne. Shortly after Emperor Ruizong's return to the throne, Wei Anshi was removed from his post as
Shizhong and made an advisor to Li Longji, now crown prince, as well as
Zuo Pushe (), one of the heads of the executive bureau (now named
Shangshu Sheng ()). As of 711, discord began to develop between Li Longji and Princess Taiping, as they vied in their struggle to influence Emperor Ruizong. Traditional historians believed that Princess Taiping was beginning to gather a faction of officials around her, intending to find fault with Li Longji as to remove him from being crown prince. She tried to include Wei in her faction, repeatedly having her son-in-law Tang Jun () invite him to her mansion, but he repeatedly declined. On one occasion, when Emperor Ruizong met with Wei alone, he told Wei, "I have heard that the officials are all loyal only to the Eastern Palace [(i.e., the Crown Prince, as the Eastern Palace was the residence for the crown prince)]. You should investigate this." Wei responded: Emperor Ruizong was surprised and took no further action and only said: However, Princess Taiping Was behind a pearl screen behind Emperor Ruizong and heard this, and she spread rumors against Wei, hoping that he would be arrested and tried, but the chancellor
Guo Yuanzhen stopped the investigations into Wei. Later that year, after the chancellors
Yao Chong and
Song Jing were removed for having proposed that Princess Taiping be settled outside the capital and that two princes with potential claims to be crown prince --
Li Chengqi the Prince of Song (Li Longji's older brother, who was also born of Emperor Ruizong's deceased wife
Empress Liu whereas Li Longji was born of Emperor Ruizong's concubine Consort Dou) and
Li Shouli the Prince of Bin (the oldest son of Emperor Ruizong's older brother
Li Xian (note different character than Emperor Ruizong)) be sent out of the capital to serve as prefectural prefects, Wei again became
Shizhong and was said to be largely in charge of civil service affairs, along with
Li Rizhi. It was said that under Wei's and Li Rizhi's oversight, the civil service affairs, which had fallen into a state of confusion during Emperor Zhongzong's reign and which Song and Yao had tried to streamline, again became unwieldy. Soon thereafter, Wei was again made
Zhongshu Ling. Four months later, he was made advisor to Li Longji and
Zuo Pushe (左僕射, also a head of the executive bureau), but retained chancellor status with the designation
Tong Zhongshu Menxia Sanpin. It was said that, however, his actual powers were limited, as Princess Taiping, who was extremely influential on Emperor Ruizong's decisions at the time, seeing that Wei would not join her faction, decided to pile honors and titles on him but strip him of actual authority. Three months later, as part of a major governmental reorganization, Wei, along with Guo,
Dou Huaizhen, Li Rizhi, and
Zhang Shuo, were removed from their chancellor posts, with Wei acting only as
Zuo Pushe and also put in charge of Luoyang (the capital having been moved back to Chang'an when Emperor Zhongzong returned to the throne). == During Emperor Xuanzong's reign ==