During Emperor Zhongzong's Second Reign
In 705, Wu Zetian was overthrown, and Li Zhe, then carrying the title of crown prince and having changed his name to Li Xian, returned to the throne. His wife again became empress, and Wei Wen, as her closest male relative (as her father Wei Xuanzhen had died in exile and her brothers Wei Xun (韋洵), Wei Hao (韋浩), Wei Dong (韋洞), and Wei Ci (韋泚) had been killed by the local tribal chieftain Ning Chengji (寧承基)), was made the minister of rites (禮部尚書, Libu Shangshu) and created the Duke of Lu. Many of his relatives also were honored, as Empress Wei wanted to promote her relatives.
In 709, Wei Wen was made Taizi Shaobao (太子少保), an advisor to the crown prince (but entirely honorary post at that time, as there was no crown prince) and given the designation Tong Zhongshu Menxia Sanpin (同中書門下三品), making him a de facto chancellor.
Read more about this topic: Wei Wen