The Shanghai City God Temple (Chenghuang Miao) can be traced back to Late-Yuan/Early-Ming Dynasty figure Qin Yubo. An official during the troubled times of the Yuan Dynasty, Qin eventually gave up his high position, and escaped to what was then the small town of Shanghai. The Ming Dynasty was later ushered in with the ascension of its first ruler Zhu Yuanzhang who implored the talented and scholarly Qin Yubo to come back and claim an official post in his government. Qin Yubo at first refused the request, but under the threat of death, he eventually had no choice but to comply and j oin the Ming Dynasty rulership. After Qin's death, Zhu Yuanzhang conferred him the post humus title, Chenghuang Zhishen — Shanghai's god of the city.
Shanghai's City God Temple (Chenghuang Miao) was finally created during the reign of Ming Ruler, Yong Le (1403-1424). The county magistrate, Zhang Cunyue, decided not to build a new temple from the ground up, but to have the Jinshan Spirit Temple converted into the C City God Temple (Chenghuang Miao). To do this, the statue of Huo Guang, (the area's Guardian General) who was worshipped in the Jinshan Temple, was moved to the front of the temple and the statue of Qin Yubo was placed in the back. Over the course of history, the temple was destroyed and rebuilt a number of times, but during the temple's latest construction, not only was the temple's audience hall and central chamber rebuilt, but the rafters and ridgepoles were painted, the tiles were painted green, and the eaves colored red. Other halls such as the Royal Mausoleum, Constellation Hall, Yama's Palace, Temple of the God of Wealth, Wenchang's Palace, Immortal Xu's Hall, and Yuqing's Palace were added on to expand the temple. At the end of the Second World War, people started referring to Chenghuang Miao Temple as the Old Chenghuang Miao in order to differentiate it from the Chenghuang Miao market area at Jinlin Xilu and Lianyun Lu.
The City God Temple (Chenghuang Miao) still occupies a sacred place in the hearts of elderly Shanghai residents. At every holiday, the devout step up to the entrance of the temple, buy packs of incense and make wishes in front of the City God Temple. The curling smoke of their burning incense carries their wishes fluttering high up into the Shanghai sky.