Vaccinations can protect against certain viruses that cause STDs. For example, the HPV vaccine can protect against strains of HPV that cause cervical cancer and genital warts. It is recommended for both males and females, usually starting from ages 11-12.