In this paper, a simple and selective molecularly imprinted polymer film-based electrochemical sensor is made by electropolymerizing glycine in the presence of Sunset yellow (SY) as a template. The thin film electro-polymerization was characterized by cyclic voltammetry and square wave voltammetry. The optimization of important parameters, the removal of Sunset yellow from the developed electrode, analytical performance, and the analysis of a real sample are described. The results showed that the developed sensor is highly selective in the presence of interferents such as sodium chloride, glucose, benzoic acid, lemon yellow and tartrazine up to a 200-fold higher concentration. Under optimized conditions, the linear dynamic range was found to range from 2 to 100 μM, with LOD and LOQ values of 0.753 μM and 2.48 μM respectively. When the proposed sensor was used for the evaluation of a real sample (tomato sauce), a similar result was observed in comparison to high performance liquid chromatography evaluation, indicating the good reliability of our modified sensor. In summary, our proposed sensor is promising for the detection of SY in food products.