BackgroundThis study aimed to assess the knowledge, attitudes, and practices (KAP) of the general population to community-acquired pneumonia (CAP) and COVID-19.MethodsA cross-sectional study was conducted between September 2022 and February 2023, involving the general population from Ningbo Municipal Hospital of Traditional Chinese Medicine with a self-developed questionnaire.ResultsA total of 637 valid questionnaires were collected, with the majority of participants being female (62.48%). The mean score for knowledge, attitudes, and practices were 7.60 ± 2.39 (possible range: 0–12), 43.20 ± 4.57 (possible range: 11–55), and 34.57 ± 4.95 (possible range: 10–50), respectively. Multivariate logistic regression analysis indicated that master’s degree or above (OR = 6.04, 95% CI: 1.80-20.31, P = 0.004) and occupation in business or service careers (OR = 0.28, 95% CI: 0.17–0.48, P < 0.001) were independent associated with knowledge. The knowledge (OR = 1.32, 95%CI: 1.20–1.44, P < 0.001) and female gender (OR = 1.48, 95%CI: 1.03–2.14, P = 0.036) were independently associated with positive attitudes. Attitudes (OR = 1.34, 95%CI: 1.26–1.43, P < 0.001) and a monthly household income greater than 20,000 RMB (OR = 0.31, 95%CI: 0.15–0.64, P = 0.001) were independent associated with practices. Pearson correlation analysis revealed that knowledge positively correlated with attitude scores (r = 0.348, P < 0.001) and practice scores (r = 0.259, P < 0.001), and attitude and practice scores were also positively correlated (r = 0.563, P < 0.001). Structural equation modeling showed that knowledge predicted attitudes (β = 0.67, P < 0.001) and practices (β = 0.17, P = 0.017), while attitudes predicted practices (β = 0.58, P < 0.001).ConclusionGeneral population had moderate knowledge, positive attitudes and average practices towards CAP and COVID-19.