He started his rebellion in 874 at Changyuan (長垣, in modern Xinxiang, Henan), in the midst of serious natural disasters—alternate floods and droughts—that severely affected the part of the empire east of the Hangu Pass (i.e., modern Henan, Hebei, and Shandong) that the imperial government was taking little action to relieve the people from the effects of.
His rebellion began with a thousand men, but quickly, after he and his ally Shang Junzhang (尚君長) captured Pu and Cao (曹州, in modern Heze, Shandong), their forces increased to tens of thousands, and when the military governor (jiedushi) of Tianping Circuit (天平, headquartered in modern Tai'an, Shandong), Xue Chong (薛崇), tried to intercept Wang's forces, Wang defeated him.
Song Wei (宋威) the military governor of Pinglu Circuit (平盧, headquartered in modern Weifang, Shandong) then volunteered to attack Wang.
However, several days later, reports arrived that Wang was not killed, and the troops were again mobilized, much to the soldiers' distress and anger.
[1] When Pei's petition arrived at the imperial government, most of the chancellors opposed, arguing that several years prior, Emperor Xizong's father Emperor Yizong had refused to pardon the rebel Pang Xun and had been able to defeat Pang, and that pardoning Wang Xianzhi would encourage further rebellions.
Emperor Xizong thus agreed, issuing Wang commissions as an officer of the Left Shence Army (左神策軍) as well as imperial censor.
The negotiations reached such a stage that Wang Xianzhi sent Shang Junzhang to personally meet with Yang to settle on details.
[3] Late in 877, Wang Xianzhi marched south and put Jiangling, the capital of Jingnan Circuit (荊南) under siege.
Li Fu, then the military governor of nearby Shannan East Circuit, however, sent forces to aid Yang, and Wang abandoned the siege on Jiangling.