The only sure-fire way to avoid getting genital herpes is to abstain from sex or have sex only with someone who is also herpes-free. Short of that, a latex condom offers some protection if it covers the infected area. Remember, you can get genital herpes by receiving oral sex (fellatio, cunnilingus, analingus) from someone with a cold sore on the mouth. Likewise, you can get oral herpes from someone's genitals by way of oral sex. Keep in mind that your partner can be contagious even without visible sores.
If you know that a sex partner has genital herpes, you can reduce your risk by having sex (vaginal, anal, or oral intercourse) only when he or she has no symptoms. Nevertheless, genital herpes can be contagious even when there are no visible symptoms, so you should always use a latex barrier, such as a condom or a dental dam.
If your partner has a known history of herpes, the rate of transmission can be decreased by having your partner on a daily prophylactic (preventative) dose of antiviral herpes medication like acyclovir. Your partner’s doctor can prescribe this.
Studies are under way to investigate medicated gel products that can be placed in the vagina to reduce the transmission of herpes and HIV. These may be available in the near future.