Listeriosis is a rare but serious foodborne disease caused by Listeria monocytogenes. This matched case–control study (1:1 ratio) aimed to identify the risk factors associated with food consumption and food-handling habits for the occurrence of sporadic listeriosis in Beijing, China. Cases were defined as patients from whom Listeria was isolated, in addition to the presence of symptoms, including fever, bacteraemia, sepsis and other clinical manifestations corresponding to listeriosis, which were reported via the Beijing Foodborne Disease Surveillance System. Basic patient information and possible risk factors associated with food consumption and food-handling habits were collected through face-to-face interviews. One hundred and six cases were enrolled from 1 January 2018 to 31 December 2020, including 52 perinatal cases and 54 non-perinatal cases. In the non-perinatal group, the consumption of Chinese cold dishes increased the risk of infection by 3.43-fold (95% confidence interval 1.27–9.25, χ2 = 5.92, P = 0.02). In the perinatal group, the risk of infection reduced by 95.2% when raw and cooked foods were well-separated (χ2 = 5.11, P = 0.02). These findings provide important scientific evidence for preventing infection by L. monocytogenes and improving the dissemination of advice regarding food safety for vulnerable populations.