The HPV vaccine protects against the types of HPV that cause cancer. It is possible to get other types of HPV after being vaccinated, but the risk for serious illness as a result of that infection is significantly reduced.