The HPV vaccine is highly effective in protecting against cancers caused by HPV infections. It’s best to get the HPV vaccine before becoming sexually active but those who are sexually active will also benefit from getting vaccinated. The HPV vaccine is recommended for girls and young women is up to 26 years old and for boys and young men is up to 21 years old.