This paper aims to examine the understanding of teachers' sociolinguistic representations of languages and their attitudes towards using code-switching (CS) in the classroom. While previous literature has explored the linguistic and functional aspects of CS, the attitudinal dimension towards code-switching remains largely unexplored. Therefore, the paper attempts to provide an attitudinal analysis of interviews with high school teachers to demarcate the way linguistic representations are conceived in the educational context. The study uses the interview technique to elicit information from ten selected teachers. The data is comprised of a collection of both oral data produced in French and, in a few instances, rarely identified as Arabic (standard or dialectal). The study focuses on the content analysis of the epilinguistic discourses of teachers in plurilingual environments. The findings reveal that teachers generally possess a well-developed language awareness, especially those who teach languages (DL). However, some aspects of the sociolinguistic landscape are not fully perceived, such as the use of Spanish in the communication of Moroccan speakers in the northern parts of the country. The study also reveals that Moroccan teachers generally have a high level of language awareness and positive attitudes towards CS. The use of CS is often in response to a didactic or communicative need felt by the teachers and dictated by the learners' deficient language skills. Certain components of the sociolinguistic dynamic remain insufficiently perceived, mainly the presence of the Spanish language in northern Morocco. These findings have proved to be significant because they first emphasize the crucial role of promoting language awareness and equipping teachers with the knowledge and skills necessary to navigate the linguistic landscape of their classrooms, and second they highlight the need for further research and education on the diverse sociolinguistic realities of language use in the classroom.