Temple · in Old City and Yu Garden
Shanghai Confucian Temple
上海文庙Shànghǎi Wénmiào
Shanghai's Confucian temple, rebuilt on this site in the 1850s, closed for renovation in 2021; its Sunday old-book market now trades near Yu Garden.
- Built
- c. 1855–1856
- Architect
- Not recorded
- Style
- Not recorded
- Heritage listing
- Shanghai Municipal Protected Cultural Relic (上海市文物保护单位) · municipal · 2002
- Status
- Closed
- Then in
- Chinese walled city1553–9999

Shanghai Confucian Temple (Wen Miao), Old City, 2016.
Photo: Stefan Fussan · CC BY-SA 3.0What you're looking at
- The Lingxing Gate at the front of the temple axis (visible once the temple reopens).
- Dacheng Hall's roof ridge, with the brick inscription 'Haibin Zou Lu' written by Lin Zexu.
- The Kuixing Pavilion, a three-storey hexagonal pavilion about 20 m high in the southeast corner.
The story
The Shanghai Confucian Temple (上海文庙, Shànghǎi Wénmiào) at 215 Wenmiao Road was the Qing-dynasty county school temple of Shanghai, and it is the only temple in urban Shanghai dedicated to Confucius. It has been closed for renovation since October 2021, and no reopening date turned up in recent sources. Its Sunday second-hand book market, long a reason for Shanghai readers to come, now meets elsewhere.
The first temple was begun in 1294, under the Yuan dynasty, near the county office, and was moved several times. In the 1850s the Small Swords Society used the Minglun Hall of the earlier temple as a headquarters. Chinese Wikipedia dates this to the uprising of 1853, and English Wikipedia says 1851 to 1855. The earlier site was largely destroyed, and the temple was rebuilt on its present site in the mid-1850s.
In 1932 the Zunjing Pavilion became a municipal library with more than 15,000 books, described as Shanghai’s first public library. After 1949 the temple was listed as a district protected site in 1959. It was damaged in the 1960s and 1970s, when buildings such as the Zunjing Pavilion were pulled down, and partly restored from 1979. A full renovation between April 1997 and September 1999 rebuilt halls and restored the Qing-era layout. The temple was designated a Shanghai municipal protected site in 2002.
The complex has two north-south axes: the temple axis, with the Lingxing Gate, Dacheng Gate, Dacheng Hall and Chongsheng Shrine, and the school axis, with the Minglun Hall and the Zunjing Pavilion. A garden lies to the east. Dacheng Hall is about 14 metres high with a double-eaved roof. A brick inscription on its ridge, “Haibin Zou Lu”, was written by Lin Zexu (林则徐), and the walls around the hall carry the text of the Analects on blue-stone tablets.
From 1986 a second-hand book market was held every Sunday on the square in front of Dacheng Hall, and by the 1990s it was Shanghai’s best-known. When the temple closed in October 2021, the market moved out. Many stallholders went to commercial buildings near Yu Garden. Shanghai Observer reported in February 2026 that the market had reopened in January, trading from 6 a.m. on Sundays on the fourth floor of the Fumin Building. A newspaper essay from the same month counted fewer than twenty stalls there on 18 January, with perhaps ten selling real second-hand books, and mentioned a dispute between old and new landlords. Hours differ between reports, so check before going.
From the archive

Plan of the temple from the 1871 Shanghai county gazetteer.
Map: Shanghai county gazetteer, 1871, public domain, via Wikimedia CommonsHow to visit
- Status
- Closed
- Opening times and prices not yet confirmed; check before you go.
- Nearest metro
- Metro directions will be added after a site visit.Plan a metro journey here →
Chinese address — show this to a taxi driver
上海市黄浦区文庙路215号
215 Wenmiao Road, Huangpu District
Amap (高德地图) works best in mainland China; Apple Maps on iPhone. Both open in the app when it is installed.
Nearby
Loading map…
Within a 10-minute walk
- Fazang Temple法藏讲寺10 min walk
- Baiyun Taoist Temple (White Cloud Temple, Shanghai)白云观10 min walk
Within a 20-minute walk
- Xiaotaoyuan Mosque小桃园清真寺11 min walk
- Dajing Pavilion大境阁14 min walk
- Former Site of the Provisional Government of the Republic of Korea大韩民国临时政府旧址14 min walk
- Shikumen Open House Museum屋里厢石库门民居陈列馆15 min walk
On these walks
People
Ding Richang丁日昌Shanghai daotai, Jiangsu governor, Qing official
Sources
- 1.Chinese Wikipedia (article given in each fact's locator) (中文维基百科), Wikimedia Foundation — https://zh.wikipedia.org/wiki/上海文庙; https://zh.wikipedia.org/wiki/上海文庙#歷史; https://zh.wikipedia.org/wiki/上海文庙#相关活动; https://zh.wikipedia.org/wiki/上海文庙#建築wikipedia
- 2.English Wikipedia (article given in each fact's locator) (English Wikipedia), Wikimedia Foundation — https://en.wikipedia.org/wiki/Confucian_Temple_of_Shanghai#Historywikipedia
- 3.Wikidata (coordinates, identifiers, heritage claims) (Wikidata), Wikimedia Foundation — https://www.wikidata.org/wiki/Q1909323wikidata
- 4.Shanghai's largest second-hand book market reopens (清晨六点的书香回来了!上海最大旧书市场重启,等你来翻页), 上观新闻 (Shanghai Observer), 上观号, 2026 — https://www.shobserver.cn/sgh/detail?id=1712387article
- 5.Memories of hunting for books at the Wenmiao old-book market (文庙旧书市集淘书回忆), 蒋俭, 文汇报 (via 中国作家网), 2026 — https://www.chinawriter.com.cn/n1/2026/0201/c404018-40657254.htmlarticle