As of 713—by which time Emperor Ruizong had yielded the throne to Li Longji, who took the throne as Emperor Xuanzong, but Emperor Ruizong was still retaining power as Taishang Huang (retired emperor) -- Cui Riyong was serving as the secretary general of Jing Prefecture 荊州 (roughly modern Jingzhou, Hubei). At that time, Emperor Xuanzong and Princess Taiping were locked into a power struggle, and when Cui happened to be in Chang'an on official business on one occasion, he suggested to Emperor Xuanzong that he suppress Princess Taiping's party. Emperor Xuanzong, who received similar advice from Wang Ju () and Zhang Shuo, agreed, and as part of the preparation, made Cui the secretary general of Yong Prefecture. It was further said that Princess Taiping, Dou Huaizhen, Cen Xi, Xiao Zhizhong, Cui Shi, Xue Ji; along with other officials Li Jin 李晉 the Prince of Xinxing (a grandson of Li Deliang (), a cousin of Tang's founder Emperor Gaozu), Li You (), Jia Yingfu (), Tang Jun (); the generals Chang Yuankai (), Li Ci (), and Li Qin (); and the monk Huifan (), were plotting to overthrow Emperor Xuanzong. It was further said that they discussed, with the lady in waiting Lady Yuan to poison the gastrodia elata that Emperor Xuanzong routinely took as an aphrodisiac. When this alleged plot was reported to Emperor Xuanzong by Wei Zhigu, Emperor Xuanzong acted. He convened a meeting with his brothers Li Fan () the Prince of Qi, Li Ye () the Prince of Xue, Guo Yuanzhen, along with a number of his associates — the general Wang Maozhong (), the officials Jiang Jiao () and Li Lingwen (), his brother-in-law Wang Shouyi (), the eunuch Gao Lishi, and the military officer Li Shoude () — and decided to act first. On July 29, Emperor Xuanzong had Wang Maozhong take 300 soldiers to the imperial guard camp to behead Chang and Li Ci. Then, Jia, Li You, Xiao, and Cen were arrested and executed as well. Dou and Princess Taiping committed suicide. Emperor Ruizong yielded powers to Emperor Xuanzong and no longer actively participated in policy decisions thereafter. For his participation, Cui was made the minister of civil service affairs (吏部尚書, Libu Shangshu), but was rebuffed in his attempts to return to chancellorship. On one occasion, at Emperor Xuanzong's birthday, he offered Emperor Xuanzong a collection of poems from the Mao Edition of the Shi Jing, as well as the text of the declaration Sima Xiangru wrote for Emperor Wu of Han when Emperor Wu was set to offer sacrifices to heaven and earth at Mount Tai. In doing so, Cui was said to be trying to correct Emperor Xuanzong's behavior, and Emperor Xuanzong, appreciating the offering, issued an edict thanking him and awarding him with a robe and silk.