Abstract Expanding expenditures and emphasis on sustainable marketing necessitate additional research to comprehend how to effectively influence sustainable attitudes and behaviour, particularly in the under-researched realms of social media. The role of social media in creating and building attitudes towards sustainable purchasing is vastly underexplored. Based on social learning theory and the theory of planned behaviour, the present study has been endeavoured to investigate the factors that influence consumers’ sustainable purchase attitudes and intentions. With the data sets obtained from three hundred 50 respondents, structural equation modelling (SEM) was employed using AMOS 22.0. From the study findings, it is observed that social media usage, social influence, drive for environmental responsibility, and perceived trust in social media are the major antecedents of consumers’ sustainable purchasing attitudes, which in turn influence their sustainable purchase intentions. It is pertinent for prominent stakeholders, including governments and regulatory agencies, to employ the findings of this study while designing campaigns to encourage individuals to practise sustainable buying behaviour. Fostering sustainable buying behaviour could help mitigate the negative consequences of impulsive purchasing on human beings and the environment. Thus, deciphering the function of social media in promoting sustainable purchasing attitudes makes the current research novel and valuable.