It is generally not recommended to have sex while experiencing a yeast infection. Yeast infections can cause discomfort, itching, and irritation, and engaging in sexual activity can further irritate the affected area and potentially spread the infection to your partner.