Karpaka Vinayakar Temple

Karpaka Vinayaka Temple or Pillaiyarpatti Pillaiyar Temple is a 7th-century CE rock-cut cave shrine, significantly expanded over the later centuries. It is located in Pillayarpatti village in Tiruppathur Taluk, Sivaganga district in Tamil Nadu, India.
The temple is dedicated to Karpaka Vinayakar (Ganesha). In the cave temple, there are rock cut images of Ganesha, Siva linga and another carving that has been variously identified as Ardhanarishwara or Harihara or the early king between them who built this temple. All these are notable for their unusual iconography. In late 19th-century, during restorative excavation and repair work, "panchaloga" statues were discovered. These are dated to the 11th-century.
The temple has several inscriptions within the rock-cut shrines, as well as on the walls and mandapam outside. One of them mentions "Desi vinayakar" and also helps date the core layer of this temple to the 7th-century Ganesha. Another notable inscription in the sanctum is more archaic, sharing paleographic features of Tamil Brahmi and early Vatteluttu. This has led to proposals that portions of this Ganesha temple are likely older by a few centuries. The temple walls and mandapams have additional stone inscriptions from the 11th to 13th-century.
The temple is one of the nine ancestral Hindu temples of the Chettiars, its importance established in their tradition in Kali year 3815 (714 CE). The temple has a large colorful gopuram, with large mandapams elaborately decorated with frescoes, many shrines inside, "salas" originally added for dance and hymns singing, temple kitchen, an architecture that follows the Agamic texts and Shilpa Sastras, and a large temple tank to its north. Most of these were added in later centuries to the core rock-cut cave shrine. The temple is active and attracts numerous pilgrims, particularly women, on the annual festivals and chariot processions such as on Vinayaka Chaturthi and the Brahmothsavam in the Tamil month of Vaikasi.
Location.
The Karpaka Vinayakar temple is located on the eastern edge of a rocky hill in Pillayarpatti village (also spelled Pillaiyarpatti). The temple is about northeast of Madurai city and northwest of Karaikudi town in Tamil Nadu. Pilliyarpatti is located about 12 kilometers east of Tiruppathur, another significant center of historic temples with intricate stone carvings. Pillayarpatti is accessible by National Highway 36 and State Highway 35. The image of Karpaga Vinayagar is carved out in a cave of Pillaiyarpatti Hillocks in this village. Thiruveesar (Shiva) is also carved in the rock of this cave, along with several other bas-reliefs all from 7th-century.
History and architecture.
The early Pandya dynasty ruled the southern part of the ancient Tamil region from about the 3rd-century BCE and they remained a major power for nearly 1,000 years. They lost their hold on their kingdom to the Cholas for a few centuries, and then returned to power about the 12th-century. They were instrumental in patronizing literature, arts and religious architecture, as well as sharing of ideas and trade with northern kingdoms of ancient India. The Karpaka Vinayakar temple is a testimony and one of the evidence of the early Pandya dynasty contributions to the South Indian heritage.
The temple in its contemporary form has many layers of additions and restorations completed over nearly 1,400 years. The earliest layer that can be dated with certainty is the 7th-century rock-cut cave temple. This rock-cut cave is attributed to Narasimhavarma, c. 650 CE. Several rock-cut Hindu gods and goddesses are displayed in this earliest layer. The cave also includes inscriptions and unusual iconography. There are several stone sculptures in the cave, on different faces of the natural rock: 
Later expansions added several mandapams (Maha, Thirumurai, Alankara), another Shiva shrine, a Nataraja, a Chandesar shrine, and a Sivakami Amman shrine. On the southern side of mandapam, parallel and near to the excavated cave is a panel with the "Saptamatrikas" (also called Saptha Kannimar, seven mothers or seven virgins), The temple also includes shrines or dedicated area for Bhairavar (Shiva form) with his dog, Somaskandhar, Kartikeya with his two wives, Karthiyayini (who arrange marriages), Nagalingam (who gifts offspring), Pasupatheeswarar (who showers all wealth), Navagrahas, and two gopurams (east and north sides). For charitable functions, like large Shaiva tradition temples, the Karpaka Vinayakar has a large temple kitchen called "madapalli", and a temple well inside the mandapam to provide water for pilgrims. The temple also has space for devotional singing of hymns and performance arts.
Religious importance and festivals.
This temple is one of the nine ancestral Hindu temples of the Chettiars, a merchant and trading community: It is maintained by the Chettiars trust (Nagarathars), but their tradition states that they have maintained and worshipped in this Shaivism tradition temple since Kali year 3813 (same as 714 CE). Chettiars have organized their conservation and temples initiatives through sub-communities based on Shiva Temples such as the Pillayarpatti Pirivu, Elayatrankudi Pirivu. This is considered as a Shiva tradition temple, given its historic importance with Shiva linga and the Karpaga Vinayaka. 
The temple is a major center for annual Vinayaka Chaturthi festival. It is celebrated for 10 days. On the 9th day the chariot festival is held, where Hindus of the region gather and participate in a procession that goes through the streets. The Ganesha is covered with gold foil and carried in a moosaka vahana, along with Nataraja and Sivakami. Additionally, the temple features floor decorations, exhibitions, performance arts and sandal covering ( Santha-na-kkappu) over these days. This tradition became more significant since festival idols made of panchaloga were found in late 19th-century during the temple repairs and renovation. These are likely from the 11th-century. The Vinayaka Chaturthi (Ganesha Chaturthi) is popular among Tamil women.
Administration.
The temple opens at 6 in the morning and stays open till 1 PM. The shrine is again opened at 4PM and is open till 8.30 PM. It is an active temple, with daily worship services. On 1 May 2017, Kumbhabhishekham was performed at this temple.