The HPV vaccine is designed to protect against the types of HPV that most commonly cause cancer and genital warts. The vaccine stimulates the immune system to produce antibodies that will recognize and fight the virus if the person is exposed to it in the future. It is most effective when administered before individuals become sexually active.