It used to be thought that use of an intrauterine device (IUD) increased the risk of pelvic inflammatory disease. However, having a variety of sexual partners appears to be the real culprit. Women who use an IUD with a single partner are at no increased risk of the disease.
For those with multiple partners, certain other kinds of contraceptive devicescondoms, diaphragms, and spermicidesprovide greater protection against the bacteria that cause PID than does an IUD. Barriers such as condoms or diaphragms physically prevent the bacteria from moving up the reproductive tract just as they prevent the passage of sperm. Spermicides used with these barrier methods, especially one called nonoxynol 9, can kill the bacteria that cause PID infections. Don't overdo it, however. Excessive use of spermicides can irritate the vaginal lining, increasing the danger of HIV infection. Also avoid excessive douching. Frequent douches after sex can increase the risk of PID by pushing bacteria further up into the reproductive system.
Oral contraceptives don't block the passage of bacteria, but they do hinder them, lowering the risk of contracting PID and often keeping the infection milder. They accomplish this by increasing the thickness of cervical mucus which makes it more difficult for bacteria to move up the reproductive system. They also decrease menstrual flow, which presumably limits the opportunity for bacteria to grow in the upper reproductive tract.