Anthelmintic residues in livestock dung can adversely affect beneficial organisms. Targeted selective treatment (TST) of a reduced proportion of livestock with anthelmintics can slow resistance development in gastrointestinal nematodes by providing residue-free dung which could also benefit non-target organisms. We tested effects of TST on survival and reproduction of the dung beetle Onthophagus taurus (Scarabaeidae) in a factorial glasshouse experiment (Experimental treatments: five TST levels, 0.00, 0.25, 0.50, 0.75, 1.00 x four ivermectin concentrations, 125, 250, 375, 500 ppb). Each mesocosm comprised a 60 L bin containing sand, four dung pats and six pairs of adult beetles (F0 generation). No effects of TST level and ivermectin concentration on mortality of F0 adults after one week were observed. F0 adult brood ball production was affected by TST level, particularly at high ivermectin concentrations. Brood ball production increased as more untreated pats became available, with greater increases at higher ivermectin concentrations. We tested for evidence of a reported attraction of dung beetles to ivermectin-treated dung using a novel glitter-marker to trace the origin of dung used in brood balls. Where mesocosms contained both dung types, the proportion of brood balls created from untreated dung showed no statistical difference from the null expectation based on untreated dung availability in the mesocosm. Emergence of F1 adults was affected by the increase in TST, with this effect dependent on concentration. Treatments with concentrations of 250–500 ppb had the lowest emergence rates (ca. 5–20 % in mesocosms where all dung pats were treated) but emergence rates increased with TST level, reaching 68–88 % emergence where no dung pats were treated with ivermectin. Ivermectin-induced mortality occurred predominantly at egg and first instar stages. TST can provide refuges for dung beetles offering a strategy for livestock producers to maintain livestock welfare whilst benefiting from ecosystem services provided by important insects.