The easy attachment of biofouling on the tooth surface benefits the development of dental plaque, which eventually leads to dental diseases, such as dental caries. It is difficult for traditional antimicrobial agents to achieve the desired effect due to the dilution of saliva and the decomposition of enzymes in the oral cavity. In addition, selective antimicrobial activity is highly required to maintain balanced healthy oral microflora. Here, inspired by the self-cleaning properties of oral mucosa, a peptide−polymer conjugate, DDDEEKRWRWRWC-PEG (DRWP), was developed that integrates targeting, antibacterial, and antifouling properties. The amino acids such as arginine and tryptophan on DRWP afford an environment-adaptive antibacterial ability against cariogenic bacteria upon (de)protonation. By virtue of the strong and stable affinity with the tooth surface, DRWP acts as a protective layer to inhibit the adhesion and colonization of nonspecific proteins and microbes, further preventing the formation of biofilms on the tooth surface. The experiment in vivo demonstrates that DRWP can effectively diminish the onset and severity of dental caries without impacting oral microbiota diversity and surrounding mucosal tissues. These findings prove the great promise of DRWP in mouthwash for caries prevention and other bacterial infectious dental diseases.