Chenghuang—City God, Judge, and Underworld Official

According to the Book of Rites, the eight gods revered during the zha[1] ceremony are Xianse (who first taught man agriculture, also called Shennong); Sise (who taught man of sowing and reaping, also called Houji); Nong (god of fields); Youbiaozhui (god of boundaries between fields and the huts for agricultural officials placed on such boundaries); Maohu (god of cats and tigers, animals thought to benefit agriculture); Fang (god of dykes); Shuiyong (god of irrigation channels); and Kunchong (god of insects). Of the seventh among these, Shuiyong, the classic text explains, “shui means huang (dry moat) and yong means cheng (city wall),” showing the importance given by ancient emperors to moats and walls.

Chenghuang, city god that protects cities and their moats, originated as deities of farms and irrigation channels. Later, chenghuang became village guardians, and today are revered as protector gods of the nation and its people. Homage paid to city gods has evolved from nature worship into a folk religion whose adherents pray for justice and safety.
Zhu Yuanzhang, the first emperor of the Ming Dynasty, held particular respect for chenghuang, bestowing feudal titles upon city gods across the land. Later, titles were created for chenghuang of prefecture (fu), sub-prefecture (zhou), and county (xian): provincial-level city chenghuang held the rank of duke (gong), and were called Weiling Gong; prefectural chenghuang held the rank of marquis (hou), and were called Suijing Hou; and county chenghuang held the rank of earl (bo), and were called Xianyou Bo.
After the Ming and the Qing Dynasties, chenghuang was no longer the name of a god but the title of a magistrate-deity who managed all the affairs of the underworld—something like a yamen or government office in the netherworld. The title was bestowed on all sorts of people, and took various forms. Most commonly, it was granted to outstanding, upright men of letters from Chinese history. Despite their varied appearances, common features of chenghuang idols include beards, official robes, and stern faces painted in black, gold, or crimson. 
The Taiwan Fu Chenghuang Temple (Taiwan Fu refers to present-day Tainan) was established in 1669—more than three hundred years ago. Previously known as the Chengtian Fu Chenghuang Temple, it was the first official chenghuang temple in Taiwan. After Taiwan became Taiwan Prefecture under the Qing Empire and was divided into Taiwan County, Zhuluo County, and Fengshan County, the temple was renamed the Taiwan Fu Chenghuang Temple.
Historic artifacts preserved in this temple can date back to the Qing Dynasty. The stone table, stone candle holders, and stone tablets were made during the reign of Qianlong Emperor (1736-1795 AD), and the columns with engraved couplets, and wooden plaques, among others were made during the reign of Jiaqing Emperor (1796-1820 AD). The Taiwan Fu Chenghuang Temple is home to the largest number of such relics among all the chenghuang temples in Taiwan. 
Red-face Chenghuang God in the main hall of Taiwan Fu Chenghuang Temple (Weiling Gong, prefectural chenghuang)
(Source: Hsing Kuo University of Management)
In contrast to other temples, which are usually brighter and more spacious, a typical chenghuang temple is dark with a mysterious ambience. Upon entering the Taiwan Fu Chenghuang Temple, looking up one immediately sees a wooden plaque that reads, “Er Lai Le,” which means “you have finally come.” This is one of the well-known Three Plaques of the Prefecture [2]. This message, along with the big abacus hanging above the door, reminds people to always be cautious, and mindful of final judgment that awaits them in the afterlife. 
Signs reading Tingshen (a hearing) and Fanggao (notice for regular hearings) hang on columns in the temple hall, which resembles an ancient Chinese court room, complete with old instruments of punishment such as shackles, chains, handcuffs, and axes. 
On either side of the chenghuang idol are the civil and military judges, Qiye and Baye (Seventh Lord and Eighth Lord), and twenty-four Si (officials). The civil judge, who holds the Book of Life and Death in his hand, keeps a record of everything one has done in life. The military judge, who holds a jianzhui, commonly known as the jiucengbian (nine-tiered truncheon), is charged with meting out punishments.
Er Lai Le—one of the Three Plaques of the Prefecture
(Source: Hsing Kuo University of Management)
“What goes around comes around”—the city god calculates one’s accumulated good and ill on a giant abacus.
(Source: Hsing Kuo University of Management)
The procession day of the Taiwan Fu Chenghuang Temple usually falls around the time of the city god’s birthday—the eleventh day of the fifth month of the lunar calendar. A unique aspect of processions touring a chenghuang idol is that they involve a nighttime patrol in addition to the normal daytime procession. The night before the procession, the deity will tour his jurisdiction in stealth, inspecting the secret doings of the people living there, and sweeping out any evils—essentially the anti-crime unit of the underworld. 
The next day, the chenghuang proceeds with the daytime inspection with great pomp and ceremony, in a way similar to how a modern high-level governmental official might tour the local regions. During such a tour, a chenghuang wards off evil, brings blessings, and confirms the borders of the territory under his influence. Qiye and Baye (Seventh Lord and Eighth Lord) always take an important role, and usually lead the procession carrying umbrellas, sacks, and xianguangbing (a bagel-shaped bread), as well as the huoqian (warrant of fire) and the hupai (sign of the tiger), respectively. 
Left: Qiye (lit: Seventh Lord, original name Xie Bi’an, also known as Bai Wuchang).
Right: Gan ye (also known as General Gan or Little Yinyang)
(Source: Hsing Kuo University of Management)
Left: Liuye (aka General Liu or Sanjiaozai).
Right: Baye (lit: Eighth Lord, original name Fan Wujiu, also known as Hei Wuchang)
(Source: Hsing Kuo University of Management)
[1] Zha (alternatively cha or la) is an official end-of-year worship ceremony of the Zhou Dynasty to pray for a new year free from natural disasters.
[2] The Three Plaques of the Prefecture: Yi (lit: one) at the Temple of Heaven (Tiantan), Liaoranshijie (lit: knowing all about the world) at the Zhuxi Temple, and Er Lai Le (lit: you have come) at the Taiwan Fu Chenghuang Temple.
Huang Boyun. The Chenghuang Temples of Taiwan. Taipei County: Walkers Cultural Enterprises, 2006.
Chen Dengwu. From the Human World to the Underworld: Law, Society, and State in the Tang Dynasty. Taipei City: Wunan Culture Enterprise, 2007.