Affective temperaments have been shown to robustly affect infertility treatment success. However, identification and understanding of possibly modifiable processes and mediating factors through which they exert their influence is still lacking. A growing number of results suggest that adherence to recommended treatments may be such a mediator because, on the one hand, affective temperaments are known to influence adherence, and, on the other hand, non-adherence negatively influences treatment outcomes. Recommended treatment of infertility involves, beyond medications, dietary and lifestyle changes. The aim of this retrospective cohort study was to evaluate whether adherence to physician-prescribed diet and physical activity recommendations mediates the effect of affective temperaments on infertility treatment outcomes. Among 308 women who underwent infertility treatment in an Assisted Reproduction Center and whose treatment plan included both diet and regular physical activity recommendations in addition to standard medical interventions, affective temperaments, adherence to diet, adherence to physical exercise, and infertility treatment success (clinical pregnancy) were assessed. Associations between affective temperaments, adherence to diet and recommended physical activity, and assisted reproduction outcomes were analyzed using generalized linear models and causal mediation analysis adjusted for age, BMI, and previous miscarriage as already known covariates. Based on regression analysis, adherence to physical activity did not have an effect (p = 0.477), but diet adherence increased the odds of infertility treatment success by 130% (p = 0.001), suggesting its role as a potential mediator between affective temperaments and infertility treatment success. Based on causal mediation analysis, higher depressive and anxious temperament scores were directly associated with a lower likelihood of achieving clinical pregnancy (direct effect: OR = 0.369 (p = 0.023), and OR = 0.554 (p = 0.013), respectively), with effects not mediated by diet adherence (mediation effect: OR = 0.917 (p = 0.259), and OR = 0.954 (p = 0.284), respectively); higher irritable affective temperament scores indirectly decreased the likelihood of achieving clinical pregnancy, mediated by diet adherence (mediation effect: OR = 0.885 (p = 0.027), direct effect: OR = 0.692 (p = 0.307)); while higher cyclothymic affective temperament scores decreased the likelihood of achieving clinical pregnancy both directly (OR = 0.492 (p = 0.027)) and indirectly, mediated by diet adherence (OR = 0.891 (p = 0.034)). Hyperthymic affective temperament had no statistically significant effect on infertility treatment success. Our results shed light on the mechanisms by which affective temperaments influence the success of IVF treatment and suggest that cyclothymic and irritable affective temperaments predict lower diet adherence, and lower adherence to the recommended diet may decrease the chances of successful infertility treatment. Since adherence is a modifiable risk factor of infertility treatment success, screening for affective temperaments may help to identify potentially high-risk non-adherent patient groups and offer patient-tailored mental health support or interventions, which may help increase the chances of a successful pregnancy and live birth in women undergoing IVF treatment.