Wei Guanzhi (韋貫之) (760 – November 13, 821), né Wei Chun (韋純), courtesy name Guanzhi (貫之) or Zhengli (正理), was an official of the Chinese dynasty Tang Dynasty, serving as a chancellor during the reign of Emperor Xianzong.
Wei Chun was born in 760, during the reign of Emperor Suzong. His family claimed ancestry from the Northern Zhou official Wei Xiong (韋敻), through Wei Xiong's son, the Sui Dynasty general Wei Shikang (韋世康). Wei Chun's grandfather Wei Xiyuan (韋希元) served as a county sheriff, while his father Wei Zhao (韋肇) reached the position of deputy minister of civil service affairs. He had one older brother, Wei Shou (韋綬), and at least one younger brother, Wei Xun (韋纁).
Wei Chun passed the imperial examinations when he was young, and early in the Zhenyuan era (785-805) of Emperor Suzong's grandson Emperor Dezong, he further passed a special examination for those considered talented and good-charactered, and thereafter was made Xiaoshu Lang (校書郎), a copyeditor at the Palace Library. After his term of service was over at the archival bureau, he was made the secretary general of Chang'an County, one of the two counties making up the Tang capital Chang'an.
Near the end of Emperor Dezong's reign, the mayor of Jingzhao Municipality (京兆, i.e., the Chang'an region), Li Shi (李實), was very powerful, and whatever he recommended to Emperor Dezong would be done within several days. When someone recommended Wei to Li, Li responded, "I have often heard of his talent, and he lives near me. I often wanted to meet him, and if I get a chance to, I will recommend him to the emperor." The person who recommended Wei to Li relayed this to Wei, but Wei, while not declining explicitly, never went to meet Li over a course of several years, and thus was not promoted during that time.
Emperor Dezong died in 805, and was succeeded by his severely ill son Emperor Shunzong who, in turn, after reigning only a few months, passed the throne to his own son Emperor Xianzong. As Emperor Xianzong was named Li Chun, Wei Chun no longer used his original name and used his courtesy name of Guanzhi instead, to observe naming taboo. Shortly after Emperor Xianzong became emperor, Wei Guanzhi was made an imperial censor with the title of Jiancha Yushi (監察御史). He submitted a petition asking that the position be given to his brother Wei Xun instead. As a result, he was made You Bujue (右補闕), a consultant at the legislative bureau of government (中書省, Zhongshu Sheng), while Wei Xun was made Jiancha Yushi. In 806, when Du Congyu (杜從郁), the son of the chancellor Du You, was set to be made Zuo Bujue (左補闕), a consultant at the examination bureau, Wei Guanzhi and Cui Qun suggested that this was improper. Initially, Du Congyu's title was reduced to Zuo Shiyi (左拾遺), a lower rank, but still a consultant at the examination bureau, Wei and Cui further clarified their rationale — that the consultants were there to suggest to the emperor corrections to make when the chancellors' governance were not proper, and they believed it improper for Du Congyu to be effectively casting judgment on his father's governance. Du Congyu thus was instead made the secretary general of the archival bureau.