Wang Ya (; died December 17, 835), courtesy name Guangjin (), formally Duke of Dai (), was an official of the Chinese Tang dynasty, serving as a chancellor during the reigns of Emperor Xianzong and Emperor Xianzong's grandson Emperor Wenzong. During Emperor Wenzong's reign, he became involved in a major power struggle between imperial officials and eunuchs known as the Ganlu Incident, and he was killed (via waist chop) by the eunuchs along with three other chancellors, Li Xun, Jia Su, and Shu Yuanyu.
Background
It is not known what year Wang Ya was born in — although he should have been born sometime between 757 and 765, as he was said to be in his 70s when he eventually died in 835. His family was from the Tang Dynasty northern capital Taiyuan and claimed to be descended from the Northern Wei official Wang Jiong (). His grandfather Wang Zuo () served as a military advisor to a prefect, while his father Wang Huang () served as a prefectural prefect. He had at least two older brothers, Wang Zhao () and Wang Jie ().
In 792, during the reign of Emperor Dezong, Wang Ya passed the imperial examinations in the class of those who used grand speech, and he was made the sheriff of Lantian County (藍田, in modern Xi'an, Shaanxi). In 804, he was made Hanlin Xueshi (), an imperial scholar. He thereafter served in the palace, going through the offices of You Shiyi (), a low-level consultant at the legislative bureau of government (中書省, Zhongshu Sheng); Zuo Bujue (), a consultant at the examination bureau (門下省, Menxia Sheng); and Qiju Sheren (), an imperial chronicler. After Emperor Dezong died in 805 and was succeeded by his seriously ill son Emperor Shunzong, Wang was one of the imperial scholars who were involved in drafting the edict to create Emperor Shunzong's son Li Chun crown prince, along with Zheng Yin, Wei Cigong (), and Li Cheng.
During Emperor Xianzong's reign
In summer 808, by which time Li Chun was emperor (as Emperor Xianzong), a special imperial examination was held for examinees to submit criticism of the government. Niu Sengru, Huangfu Shi (), and Li Zongmin were considered to have written criticisms that were particularly on point and were ranked the highest by the officials in charge of grading, Yang Yuling () and Wei Guanzhi. Initially, Emperor Xianzong was set to give commissions to Niu, Huangfu, and Li Zongmin, but the chancellor Li Jifu was offended by the criticism. As Wang Ya and fellow imperial scholar Pei Ji were the reviewers of the examination, and Huangfu was Wang's nephew, he accused Pei and Wang of conflict of interest. Due to Li Jifu's accusations, Pei and Wang were stripped of their imperial scholar status and both demoted — with Wang being made Duguan Yuanwailang (), a low-level official at the ministry of justice (刑部, Xingbu), and subsequently being sent out of the capital to serve as the military advisor to the prefect of Guo Prefecture (虢州, in modern Sanmenxia, Henan). Yang and Wei were also demoted out of the capital Chang'an. He was subsequently further made the prefect of Yuan Prefecture (袁州, in modern Yichun, Jiangxi).
However, it was said that Emperor Xianzong missed Wang, and Wang was eventually recalled to serve as Bingbu Yuanwailang (), a low-level official at the ministry of defense (兵部, Bingbu), and put in charge of drafting edicts. He was then again made imperial scholar as well as deputy minister of public works (工部侍郎, Gongbu Shilang). He was also created the Baron of Qingyuan. It was said that Wang was a talented writer and many of the edicts that had beautiful language during the reigns of Emperors Dezong and Xianzong were drafted by Wang. As Wang did not engage in partisanship, Emperor Xianzong often consulted with him.
In 816, Wang was made Zhongshu Shilang (), the deputy head of the legislative bureau, as well as chancellor de facto with the title Tong Zhongshu Menxia Pingzhangshi (). In 817, there was an occasion when Emperor Xianzong wanted to make one of his close associates, Zhang Su (), a high-level consultant, drawing a strenuous objection from the chancellor Li Fengji — and this was partially responsible for Emperor Xianzong's removing Li Fengji and making him a military governor (Jiedushi). Wang and fellow chancellor Cui Qun also objected to Zhang's commission, but eventually allowed Zhang to serve as acting consultant.
In 818, Wang was removed from his chancellor position and made the deputy minister of defense (兵部侍郎, Bingbu Shilang), as Emperor Xianzong considered him too silent and unsuitable to be chancellor. He was subsequently made the deputy minister of civil service affairs (吏部侍郎, Libu Shilang).