Shu Yuanyu (Chinese: 舒元輿; died December 17, 835) was an official of the Chinese Tang Dynasty, serving briefly as a chancellor during the reign of 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 by the eunuchs along with three other chancellors, Li Xun, Wang Ya, and Jia Su.
It is not known when Shu Yuanyu was born, but it is known that he was from Wu Prefecture (婺州, in modern Jinhua, Zhejiang), from a part that was said to be so poor that the gentry avoided it. HIs father Shu Heng (舒恆) served as an officer at Wuchang Circuit (武昌, headquartered in modern Wuhan, Hubei). Shu Yuanyu had at least three younger brothers — Shu Yuangong (舒元肱), Shu Yuanjiong (舒元迥), and Shu Yuanbao (舒元褒), each of whom (like he) would eventually pass the imperial examinations in the Jinshi class.
It was said that when Shu Yuanyu began his studies, he became known for his alertness and ability to understand. He later went to live in Jiangxia (江夏, i.e., Wuchang's capital), and the military governor (Jiedushi) Chi Shimei (郗士美) came to be impressed by his talent and often praised him.
In 813, during the reign of Emperor Xianzong, Shu passed the imperial examinations and was made the sheriff of Hu County (鄠縣, in modern Xi'an, Shaanxi); he was to be talented and to have gained a good reputation. When the former chancellor Pei Du served as the military governor of Shannan West Circuit (山南西道, headquartered in modern Hanzhong, Shaanxi), he invited Shu to serve as his scribe, and it was said that the declarations that Shu drafted for him were written so well that Shu's reputation for good writing became well-known.