Wang Pi (王伾) (died 805?) was an official of the Chinese Tang Dynasty, who was a close associate of Emperor Shunzong (Li Song). He, along with his ally Wang Shuwen, was powerful during Emperor Shunzong's brief reign in 805, but soon lost power and died in exile.
It is not known when Wang Pi was born, but it is known that his family was from Hang Prefecture (杭州, in modern Hangzhou, Zhejiang). He was at some point made a reserve official at Hanlin Institute (翰林院), where imperial scholars gathered, and later made a member of the staff of Li Song — then crown prince under his father Emperor Dezong. It was said that he became favored by Li Song because of his abilities in calligraphy, and he became a close associate of Li Song's, having easy access to Li Song's palace and often spending time with Li Song in leisure activities. He and another close associate of Li Song's, Wang Shuwen, became friends and allies.
In late 804, Li Song suffered a debilitating stroke that left him partially paralyzed and unable to speak. When Emperor Dezong died on February 25, 805, there were initially some eunuchs who suggested that someone else should succeed Emperor Dezong, but at the strong advocacy of the imperial scholar Wei Cigong (衛次公), Li Song's succession was not further questioned despite his illness. To show that he was still not completely incapacitated, Li Song was forced to personally show himself to the imperial guards, and he took the throne (as Emperor Shunzong).
However, Emperor Shunzong remained seriously ill, and he was often attended to only by the eunuch Li Zhongyan (李忠言) and his concubine Consort Niu. Much of the decisions on important matters of state were entrusted to Wang Pi and Wang Shuwen, both of whom were named imperial scholar and was largely making decisions at the Hanlin Institute. Under Wang Shuwen's recommendation, Wei Zhiyi was made a chancellor, and it was said that Wei, Wang Shuwen, Wang Pi, Li Zhongyan, and Consort Niu formed a group of decision makers. It was said that much authority were also delegated to Han Tai (韓泰), Liu Zongyuan, and Liu Yuxi, and that Wang Shuwen was effectively the leader. His associates were also said to be praising each other and comparing each other to such great historical figures as Yi Yin, the Duke of Zhou, Guan Zhong, and Zhuge Liang. Many officials were being promoted and demoted based on their recommendations. Wang Pi also received the office of Zuo Sanqi Changshi (左散騎常侍), a high-level consultant at the examination bureau of government (門下省, Menxia Sheng).