Mottai Vinayakar temple is located in the heart of Madurai city which is famous for its Meenakshi Amman temple, dedicated to Lord Ganesha. As per the lengends, Goddess Parvati created a youth for her security and named him Lord Ganapathi. Goddess Parvathi appointed him as the security for her kingdom. When Devas came kingdom for worship, Lord Ganapathi refused to let them in. When they tried to trespass, Lord Ganapathi fought and drove them away. The Devas went to Lord Shiva and appealed to him to enable them to worship Goddess Parvathi. Lord Shiva came to Lord Ganapathi and held talks with him. Lord Ganapathi maintained his determination and refused entry to Lord Shiva. Out of Agguish Lord Shiva chopped off the head of Lord Ganapathi. Goddess parvathi pleaded with the Lord to give her son life again. Lord shiva fixed the head of an elephant and elevated him to the highest status of being number one and ordered that all must worship the deities in the temples only after worshipping Lord Ganapathi. Lord Shiva also made Lord Ganapathi, the head of his security force. As a representation of this incident Lord Ganapathi appears in this temple without head as Mottai Vinayaka.
According to history the temple belongs to the period of Pandya King Chandrasekara pandian who ruled Madurai in the year 1530 AD. Goddess Parvathi with consorts of Lord Shiva created a boy for her security and named him as Lord Ganapathi. Goddess Parvathi handed over the total security of the state to him. Devas who used to worship Goddess Parvathi, once visited the state of Goddess Parvathi. As in charge of security Lord Ganapathi refused to give permission to seek gods blessings. When they insisted on their point, fight between Lord Ganapathi drove them away Devas then took the matter to Lord Siva and sought his help to see Goddess Parvathi. Lord Siva responded to Devas request and came to meet Lord Ganapathi. He had a talk with him and Lord Ganapathi refused to obey his orders. The Lord Shiva got angry and chopped off the Lord Ganapathi head. On knowing about the incident Goddess Parvathi pleaded with Lord Siva to give his son life for second time. Accepting the request of Goddess Parvathi, Lord Siva fixed the head of an elephant and made Lord Ganapathi to the highest grade. He also ordered that the devotees must pray Lord Ganapathy before they do anything or start anything new. This also applies to Lord Siva and is followed in all temples and all festivals of Hindu community. Later Lord Ganapathi was made head of his security force.