In 705, a coup led by
Zhang Jianzhi,
Cui Xuanwei,
Jing Hui,
Huan Yanfan, and
Yuan Shuji removed Wu Zetian and returned Emperor Zhongzong to the throne. At that time, Shangguan Wan'er became an imperial consort, as a powerful
concubine of Emperor Zhongzong, carrying the rank of
Jieyu (), the 14th rank for an imperial consort. (It is not stated in history whether she became his concubine before or after his return to the throne.) Emperor Zhongzong put her in charge of drafting edicts and other imperial orders. However, she carried on an affair with Emperor Zhongzong's cousin and Wu Zetian's nephew
Wu Sansi, the Prince of Liang; through her, Wu Sansi became a trusted advisor of Emperor Zhongzong and a lover of Emperor Zhongzong's wife
Empress Wei as well. (As a result, Zhang and his cohorts soon lost power and died or were killed in exile.) Subsequently, at her suggestion to Empress Wei for the latter to emulate Wu Zetian, Empress Wei submitted formal proposals to Emperor Zhongzong to require the people to observe three-year mourning periods for their mothers who had been divorced by their fathers (previously, such a mourning period was not required for a divorced mother) and reducing the period where a man was considered an adult male (and therefore subject to military and labor conscription) from the ages to 20 to 59, to the ages of 22 to 58, in order to try to gain the people's gratitude. Emperor Zhongzong approved the proposals. Meanwhile, in addition to Empress Wei and Consort Shangguan, Empress Wei's daughter
Li Guo'er, the Princess Anle, became very powerful as well, as she was Emperor Zhongzong's favorite daughter, and she had married Wu Sansi's son Wu Chongxun (). She often humiliated her brother
Li Chongjun the
Crown Prince on account that Li Chongjun was not born of Empress Wei, at times calling him "slave." She also often suggested to Emperor Zhongzong that he depose Li Chongjun and make her crown princess. In summer 707, Li Chongjun's anger erupted, and he, along with the ethnically
Mohe general
Li Duozuo and Emperor Zhongzong's cousin Li Qianli () the Prince of Cheng, rose in rebellion, first killing Wu Sansi and Wu Chongxun. He then attacked the palace, seeking to arrest Consort Shangguan. Consort Shangguan, Empress Wei, Li Guo'er, and Emperor Zhongzong were protected by the imperial guards, and when Li Chongjun hesitated at what to do next, his forces collapsed, and he and his cohorts were killed. Meanwhile, Consort Shangguan's nephew Wang Yu () had been warning her, through her mother Lady Zheng, that her continued behavior in working with the Wus and Empress Wei would eventually bring disaster on her and her clan. Consort Shangguan initially took no heed, but after Li Chongjun had demanded, by name, to arrest her during the 707 coup attempt, she became fearful, and she began to distance herself from Li Guo'er and Empress Wei, aligning herself more with Emperor Zhongzong's sister
Princess Taiping. Despite this, she and her mother Lady Zheng, along with Li Guo'er, Empress Wei, the senior
ladies in waiting Ladies Chai and Helou, the sorceress Diwu Ying'er (), and Lady Zhao of Longxi, were described as powerful and corrupt women at court, selling governmental offices at will. Consort Shangguan and the other imperial consorts were also said to, against regulations, establish mansions outside the palace. In 708, Emperor Zhongzong established an imperial academy, with four imperial scholars, eight assistant scholars, and 12 associate scholars, selecting officials with literary talent to serve as the imperial scholars. He often held feasts that would also serve as literary competitions, and he had Consort Shangguan serve as the judge at these competitions. Late in the year, he promoted her to the rank of
Zhaorong, the sixth rank among imperial consorts. In addition to writing poems in her own name, she was also said to have written poems in the names of Emperor Zhongzong, Empress Wei, Li Guo'er, and Li Guo'er's sister Princess Changning. The poems were said to be beautiful and often recited by people who heard them. By spring 709, Consort Shangguan was having an affair with the official
Cui Shi, and on account of that relationship, she recommended him to be a chancellor. Emperor Zhongzong agreed. By summer, however, Cui and another chancellor,
Zheng Yin, were charged with corruption. As a result, Cui was set to be exiled to be the military advisor to the prefect of Jiang Prefecture (, roughly modern
Jiujiang,
Jiangxi). However, Consort Shangguan, Li Guo'er, and Li Guo'er's new husband Wu Yanxiu () then spoke on his behalf secretly, and Emperor Zhongzong instead made Cui the prefect of Xiang Prefecture (, roughly modern
Xiangfan,
Hubei). (Zheng, who had been set to be reduced to commoner rank and exiled to Ji Prefecture (, roughly modern
Ji'an,
Jiangxi), was instead made the military advisor to the prefect of Jiang Prefecture.) ==Death==