Bacteria-targeting nanomaterials have been widely used in the diagnosis and treatment of bacterial infectious diseases. These nanomaterials show great potential as antimicrobial agents due to their broad-spectrum antibacterial capacity and relatively low toxicity. Recently, nanomaterials have improved the accurate detection of pathogens, provided therapeutic strategies against nosocomial infections and facilitated the delivery of antigenic protein vaccines that induce humoral and cellular immunity. Biomaterial implants, which have traditionally been hindered by bacterial colonization, benefit from their ability to prevent bacteria from forming biofilms and spreading into adjacent tissues. Wound repair is improving in terms of both the function and prevention of bacterial infection, as we tailor nanomaterials to their needs, select encapsulation methods and materials, incorporate activation systems and add immune-activating adjuvants. Recent years have produced numerous advances in their antibacterial applications, but even further expansion in the diagnosis and treatment of infectious diseases is expected in the future.