BackgroundIncreasing rates of sexually transmitted infections (STIs) and antimicrobial resistance among young people underscore the urgent need for preventative interventions. Interventions should be evidence-based and tailored to the unique risks and needs associated with varying age, sex and sexual orientation. We used data from the Safetxt trial to explore whether young people’s age, sex and sexual orientation influence (1) their risk of STI reinfection and condom use and (2) the effect of the Safetxt intervention on STI reinfection and condom use.MethodsWe conducted exploratory secondary analyses of data from the Safetxt trial that evaluated a theory-based digital sexual health intervention tailored according to sex and sexual orientation. We recruited 6248 young people with STIs from 92 UK sexual health clinics and assessed outcomes after 1 year, including the cumulative incidence of STI reinfection and condom use at last sex. We used adjusted logistic regression and margins plots to visualise effect modification.ResultsThere were differences in STI reinfection and condom use by age, sex and sexuality. Age was associated with STI reinfection (OR 0.90, 95% CI 0.87 to 0.94) with evidence for interaction between age and sexuality (p<0.001). Our findings suggest that the risk of STI reinfection decreases with age among young heterosexuals but increases among men-who-have-sex-with-men (MSM). Overall, MSM had the highest likelihood of reinfection (OR 3.53, 95% CI 2.66 to 4.68) despite being more likely to use condoms (OR 1.50, 95% CI 1.18 to 1.91).Among MSM, age modified the intervention effect on condom use at 1 year with highest benefits among participants aged 16–18, moderate to minor benefits among those aged 18–21 and no effect among participants aged 22–24 years.ConclusionsFuture digital health interventions tailored for diverse sexuality groups need to target young people early enough to have an impact on sexual behaviour. Specific novel interventions are needed for older MSM.Trial registration numberISRCTN64390461.