Background and aimsSocial networks formed through social media platforms have facilitated knowledge sharing among primary health care professionals (PHCPs). However, the impact of these networks on PHCPs’ job performance and the mediating role of knowledge sharing remain underexplored. This study aimed to investigate the association between social networks formed via social media and the job performance of PHCPs, and to explore the mediating role of knowledge sharing in this association.MethodsA cross-sectional survey was carried out among PHCPs in Henan Province, China, involving 655 valid responses. Validated scales measured the key variables, and structural equation modeling (SEM) tested the proposed hypotheses, including the mediating effect of knowledge sharing through bootstrap method. Statistical analysis was performed using SPSS 24.0 and AMOS 24.0.ResultsThe degree centrality (β = 0.225; p = 0.001) and network heterogeneity (β = 0.093; p = 0.043) of the social network had a significant direct association with job performance, whereas the direct associations of betweenness centrality and network tie strength with job performance were not significant. Knowledge sharing mediated the relationship between degree centrality (β = 0.147; p = 0.001), network heterogeneity (β = 0.251; p = 0.043), and job performance.ConclusionThe study revealed the internal mechanisms by which social network characteristics influence PHCPs’ job performance, highlighting the mediating role of knowledge sharing. Social networks formed within social media contexts have multifaceted effects on job performance, with knowledge sharing as a critical mediating variable. These findings underscore the importance of leveraging social media for professional networking and knowledge exchange to enhance PHCPs’ job performance.