We examine the content of the official Facebook pages of 502 Italian municipalities over the period 2016–2018 to empirically infer the motivations of municipalities to use Facebook. Our inference is mostly based on the relationship between the main topics discussed by the municipalities on Facebook and the most related municipal expenses per capita, which are reported by function in municipal financial statements. Using a structural topic modelling analysis consisting of an unsupervised machine learning procedure, we find that Italian municipalities mostly post on five semantically different topics on their Facebook pages. More importantly, each topic's prevalence is positively associated with the most related municipal expenses per capita by function. Furthermore, additional covariates significantly influence each topic's prevalence. Within the framework of legitimacy theory, these results indicate the strategic usage of Facebook by Italian municipalities for self-promotion and political marketing aimed at enhancing their political legitimacy and consensus among citizens. Our findings contribute to the literature on voluntary e-disclosures of local governments and on interactions between local governments and their citizens through social media. Therefore, these findings may have practical implications for public regulators, managers, and other users of social media.