Loneliness is an issue of public health significance. Longitudinal studies indicate that feelings of loneliness are prevalent and were exacerbated by the Coronavirus Disease 2019 (COVID-19) pandemic. With the advent of new media, more people are turning to social media platforms such as Twitter and Reddit as well as online forums, e.g., loneliness forums, to seek advice and solace regarding their health and well-being. The present study therefore aimed to investigate the public messaging on loneliness via an unsupervised machine learning analysis of posts made by organisations on Twitter. We specifically examined tweets put out by organisations (companies, agencies or common interest groups) as the public may view them as more credible information as opposed to individual opinions. A total of 68,345 unique tweets in English were posted by organisations on Twitter from 1 January 2012 to 1 September 2022. These tweets were extracted and analysed using unsupervised machine learning approaches. BERTopic, a topic modelling technique that leverages state-of-the-art natural language processing, was applied to generate interpretable topics around the public messaging of loneliness and highlight the key words in the topic descriptions. The topics and topic labels were then reviewed independently by all study investigators for thematic analysis. Four key themes were uncovered, namely, the experience of loneliness, people who experience loneliness, what exacerbates loneliness and what could alleviate loneliness. Notably, a significant proportion of the tweets centred on the impact of the COVID-19 pandemic on loneliness. While current online interactions are largely descriptive of the complex and multifaceted problem of loneliness, more targeted prosocial messaging appears to be lacking to combat the causes of loneliness brought up in public messaging.