Generally, short-term use of painkillers does not affect fertility. However, long-term use of NSAIDs, particularly around the time of ovulation, may potentially interfere with the release of an egg from the ovary. Opioids, when used chronically, can disrupt menstrual cycles and potentially affect fertility. It is always best to consult a gynecologist for personalized advice.