Since the detection of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) in human breastmilk, little is known about the antiviral property of human breastmilk to SARS-CoV-2 and its related pangolin coronavirus (GX_P2V). Here we present for the first time that whey protein from human breastmilk effectively inhibited both SARS-CoV-2 and GX_P2V by blocking viral attachment, entry and even post-entry viral replication. Moreover, human whey protein inhibited infectious virus production proved by the plaque assay. We found that whey protein from different species such as cow and goat also showed anti-coronavirus properties. And commercial bovine milk also showed similar activity. Interestingly, the main antimicrobial components of breastmilk, such as Lactoferrin and IgA antibody, showed limited anti-coronavirus activity, indicating that other factors of breastmilk may play the important anti-coronavirus role. Taken together, we reported that whey protein inhibits SARS-CoV-2 and its related virus of GX_P2V. These results rule out whey protein as a direct-acting inhibitor of SARS-CoV-2 and GX_P2V infection and replication and further investigation of its molecular mechanism of action in the context of COVID-19.