Only certain contraceptives are going to protect you against sexually transmitted infections (STIs) and sexually transmitted diseases (STDs) they are mostly barrier methods, specifically female and male condoms, dental dams, and diaphragms, as they prevent any sharing of bodily fluids which is how most STDs and STIs are transmitted. It is still recommended to get tested for STDs and STIs after having intercourse with a new partner, protected or not, as there is still a minor chance of spread if perhaps a condom were to break during intercourse.