Background Carriers of extended-spectrum β-lactamase–producing Enterobacteriaceae (ESBL-PE) who receive cephalosporin-based prophylaxis have twice the risk of surgical site infection (SSI) following colorectal surgery as noncarriers. We tested whether ESBL-PE screening and personalized prophylaxis with ertapenem reduces SSI risk among carriers. Methods We conducted a prospective nonrandomized, nonblinded, interventional study in 3 hospitals in Israel, Switzerland, and Serbia. Patients were screened for ESBL-PE carriage before elective colorectal surgery. During the baseline phase, departmental guidelines advised prophylaxis with a cephalosporin plus metronidazole. In the intervention phase, guidelines were changed for ESBL-PE carriers to receive ertapenem. The primary outcome was any type of SSI within 30 days. We calculated adjusted risk differences (ARDs) following logistic regression. Results The intention-to-treat analysis compared 209 ESBL-PE carriers in the baseline phase to 269 in the intervention phase. SSI rates were 21.5% and 17.5%, respectively (ARD, –4.7% [95% confidence interval {CI}, –11.8% to 2.4%]). Unplanned crossover was high (15%), so to assess efficacy we performed an as-treated analysis comparing 247 patients who received cephalosporin-based prophylaxis with 221 who received ertapenem. SSI rates were 22.7% and 15.8%, respectively (ARD, –7.7% [95% CI, –14.6% to –.8%]), and rates of SSI caused by ESBL-PE were 6.5% and 0.9%, respectively (ARD, –5.6% [95% CI, –8.9% to –2.3%]). There was no significant difference in the rate of deep SSI. The number needed to treat to prevent 1 SSI in ESBL-PE carriers was 13. Conclusions Screening for ESBL-PE carriage before colorectal surgery and personalizing prophylaxis for carriers is efficacious in reducing SSI. [ABSTRACT FROM AUTHOR]