Specific bacteria, including Fusobacterium nucleatum , Streptococcus sanguis , Enterococcus faecalis , and Staphylococcus xylosus , have been identified as contributors to breast cancer metastasis. Due to limitations such as lack of selectivity, traditional antibiotic therapies face obstacles in eliminating intratumoral bacteria. Herein, this work proposes the use of therapeutic vaccines to selectively target and eliminate harmful bacteria within tumors. A multivalent vaccine encapsulating both insoluble and soluble bacterial antigens was developed, addressing the shortcomings of traditional antibacterial vaccines by balancing broad antigen coverage with effective immune activation. This vaccine induces robust downstream immune responses to eliminate F. nucleatum , S. sanguis , E. faecalis , and S. xylosus , demonstrating notable therapeutic and preventive efficacy in bacteria-induced cancer metastasis models. Unexpectedly, vaccinated infected mice showed even slower tumor metastasis than uninfected mice. Overall, this study validates the potential of nanovaccines in modulating the intratumoral microbiome for tumor therapy and highlights tumor-associated bacterial infections as potential promising antitumor targets.