Background and purpose: The aim of this study was to identify the prevalence of modifiable risk factors of surgical site infections (SSI) in patients undergoing primary elective total joint arthroplasty (TJA) receiving conventional preoperative preparation, and to explore their association with infectious outcomes.Patients and methods: Information regarding modifiable risk factors (anemia, diabetes, obesity, nutritional status, smoking, physical activity) was prospectively gathered in patients undergoing primary TJA of hip or knee in 2018–2020 at a single institution with 6 weeks’ follow-up time.Results: 738 patients (median age 68 years [IQR 61–73], women 57%) underwent TJA (knee 64%, hip 36%). Anemia was detected in 8%, diabetes was present in 9%, an additional 2% had undiagnosed diabetes (HbA1c > 47 mmol/mol), and 8% dysglycemia (HbA1c 42–47 mmol/mol). Obesity (BMI ≥ 30) was observed in 52%. Serum albumin, total lymphocyte count, and vitamin D below normal limits was identified in 0.1%, 18%, and 16%, respectively. Current smokers were 7%. Surgical site complications occurred in 116 (16%), superficial SSI in 57 (8%), progressing to periprosthetic joint infection in 7 cases. Univariate analysis identified higher odds of superficial SSI for BMI ≥ 30 (OR 2.1, 95%CI 1.2–3.8) and HbA1c ≥ 42 mmol/mol (OR 2.2, CI 1.1–4.2), but no association was found with other factors.Conclusion: In a general population undergoing primary TJA an association was found between obesity (52%) and dysglycemia/diabetes (19%) and superficial SSI (8%), which progressed to PJI in 12% of cases, generating a 1% total rate of PJI. Modification of these risk factors might mitigate infectious adverse outcomes.