Dietary quality and patterns may influence SARS‐CoV‐2 infection and outcomes, but scientific data and evidence to support such a role are lacking. Therefore, this meta‐analysis aims to elucidate the effect of prepandemic diet quality on the risk of COVID‐19 infection and hospitalization. PubMed/MEDLINE, CENTRAL, Scopus, and EMBASE were systematically searched for articles published up to September 1, 2022. A systematic review and meta‐analysis were performed to calculate each outcome's risk ratio (RR) and 95% confidence interval (CI). Five studies including 4 023 663 individuals (3 149 784 high‐quality diet individuals and 873 881 controls) were included in the present meta‐analysis. The effectiveness of high‐quality dietary pattern against SARS‐CoV‐2 infection and hospitalization was 28% (95% CI 19%–36%) and 62% (95% CI 25%–80%); respectively. Subgroup analysis based on different levels of diet quality showed no difference between middle and high levels of diet quality in reducing the risk of COVID‐19 infection. Interestingly, subgroup analysis based on the different types of high‐quality diets and the risk of COVID‐19 infection revealed that the effectiveness of plant‐based diet against SARS‐CoV‐2 infection was 50% (95% CI 30%–65%); while the effectiveness of Mediterranean diet against SARS‐CoV‐2 infection was 22% (95% CI 12%–31%). Adherence to a high‐quality dietary pattern is associated with a lower risk of COVID‐19 infection and hospitalization. More studies are required to confirm these findings, and future studies should determine the biological mechanisms underlying the association between diet quality and risk of COVID‐19 infection.