The oldest parts of the present masonry structure were built during the Chola dynasty, while later expansions, are attributed to later periods, up to the Thanjai Nayaks during the 16th century.
The temple is maintained and administered by Hindu Religious and Charitable Endowments Department of the Government of Tamil Nadu.
The temple is associated with a sage called Herandar, who, according to legend, is believed to have gone through an underground passage to the nether world and brought the Kaveri River to the earth to flow into the Bay of Bengal.
[2] As per another legend, when Devas (celestial deities) and Asuras (demons) were churning the Ocean of milk with Vasuki the serpent, they disregarded the advice of Vinayaka.
One another inscription on the south wall of the mandapa in front of the sanctum dated to Rajaraja indicates grant of land on the 21st year of the rule of Parakesarivarman.
An inscription (ARE 633 of 1902) during the 25th regnal year of Rajaraja indicates gift of gold to the deity by Kundavai, the daughter of the king.
Another inscription dated to the 258th day during the 24th regnal year of Rajaraja on the south wall of the hall indicates tax free land to the service of two deities, namely, Kshetrapalar and Ganapatiyar.
The inscription on the north wall of the hall (ARE 633-B of 1902) dated to the third regnal year of Rajendra I (1012–1044 CE) indicates that he ceremonially passed through a hill of gingely seeds and gifted twelve gold flowers to the feet of Lord.
Another inscription from the northern wall of Bhairavar shrine during the third regnal year of Rajendra I indicates gift of two gold flowers to the deity by Danti Sakti Vitanki while he was performing Tulabhara at Thiruvisanallur.
An inscription from the 11th regnal year of Rajaraja III (1216–1256 CE) indicate that the shrine of Vanduvarkuzhali Amman might have possibly been installed during his reign.
The southeast corner houses the Valanchuzhi Vinayagar shrine was built by Tanjai Nayak Kings, after which the temple has got one of its names.
The temple rituals are performed five times a day; Ushathkalam at 6:30 a.m., Kalasanthi at 8:00 a.m., Uchikalam at 12:00 a.m., Sayarakshai at 5:00 p.m., and Ardha Jamam at 8:00 p.m. Each ritual comprises four steps: abhisheka (sacred bath), alangaram (decoration), naivethanam (food offering) and deepa aradanai (waving of lamps) for both Kabardeeswarar and Periyanayagi.
Mahashivaratri during February - March, Vinayagar Chathurthi during September and Karthikai Deepam during December are the major festivals celebrated in the temple.