According to the legends, the idol worshipped here is more than 5000 years old. But there are no historical records to establish it. In the 14th century Tamil literature 'Kokasandesam', references about a place called Kuruvayur is made. As early as 16th century (50 years after the Narayaneeyam was composed) many references are seen about Kuruvayur. In ancient Dravidic, Kuruvai means sea, hence the village on the coast may be called Kuruvayur. But according to Prof. K V Krishna Iyer (eminent historian), the Brahmins had begun to come and settle at Kodungalloor during the period of Chandra Gupta Maurya ( 321-297 BC). Trikkunavay in the Guruvayur documents is the same as Thrikkanamathilakam or Mathilakam mentioned in the Dutch and British records. And this place was in between Guruvayur and Kodungalloor. Guruvayur was Trikkunavay's subordinate shrine since they were destroyed by the Dutch in 1755. That way Guruvayur must have come into existence before 52 AD. The story of Pandyan King building a shrine here may be a reference to the Azhavars , but they are all silent in their writing about Guruvayur.
It was Melpathur's Narayaneeyam through which the Temple got publicity. The concept of Unnikrishna popularised by Poonthanam , Kururamma , and Villwamangalam brought more and more devotees to Guruvayur.
Mamankam was a very famous event at Thirunavaya, on the bank of Bharathappuzha . The war between the Zamorins and the Raja of Valluvanad of Thirunavaya in a way popularised Guruvayur temple. Due to the prolonged war people across the river bank started preferring Guruvayur. Even the Zamorin become a devotee and thus his subjects followed him completely . The central shrine which we see today is said to have been rebuilt in 1638 AD. Vishwabali was performed later to propitiate all the spirits, good and bad. By the end of 16th century Guruvayur had become most popular pilgrimage centre in Kerala.
In 1716 AD, the Dutch raided Guruvayur. They looted treasures , gold of the flag staff, and set fire to the Western Gopuram. It was later rebuilt in 1747 AD. In 1755AD ,the Dutch in war with the Zamorin destroyed Trikkunavay temple and the Brahmins fled from there. Later the Zamorin become the trustee of both Guruvayur and Trikkunavay, and also their Melkoyma (Sovereign protector).
In 1766 AD , Hyder Ali of Mysore captured Kozhikkode (Calicut) and then Guruvayur. He fined 10,000 fanams to spare the temple . This fine was paid but due to insecurity pilgrims receded , the supply of rice was stopped and the tenants stopped annual dues. On the request of the Malabar Governor, Shrnivasa Rao, Hyder Ali granted a Devadaya (free gift) and the temple was saved from extinction. Again in 1789 AD Tippu Sultan invaded Zamorin's province.
Apprehending the destruction, the idol was hidden underground and the Utsava vigraha was taken to Ambalapuzha by Mallisseri Namboodiri and Kakkad othikkan. Tippu destroyed the smaller shrines and set fire to the Temple, but it was saved due to timely rain. Tippu lost to the Zamorin and the English in 1792 AD. The idol hidden underground and the Utsava vigraha were re-installed on September 17th , 1792. But the daily poojas and routines were seriously affected.
The Ullanad Panickers rescued and looked after the temple for good 75 years ( 1825 to 1900). Like Chempakassery Namboodiri and Deshavarma Namboodiri ,the Panickers offered everything from service to property. Thus with their help daily pooja and Utsavam (annual festival ) were once again restored.
From 1859 to 1892, the Chuttambalam,the Vilakkumatam, the Koothambalam and Sastha shrine were renovated and roofed with copper sheeting. In 1900, Sri Konthi Menon , as a manager fixed the hours of worship and led the drive to keep the temple premises clean. He set up the big bell and reconstructed Pathayapura (granary). In 1928, the Zamorin once again become the administrator of Guruvayur.
In 1931-32 , Late Kelappan (known as "Kerala Gandhi" ) led the Guruvayur Satyagraha to secure the entry of lower castes in temples. The lower castes were allowed to go only up to Thiyyarambalam, more than about half kilometer from the temple. He started a fast unto death in front of the Eastern Gopuram . He broke the fast at the insistence of Mahatma Gandhi. It did not produce any immediate result but led to the entry of Dalits in various Kerala temples.
In 1947, the Guruvayur temple was also opened for the entry of all Hindus. Later, namaskara sadya (feast ),which was only for Brahmins was scrapped and was opened to everyone irrespective of caste