Benzotriazole ultra-violet stabilisers are compounds widely used in personal care products, which can reach the environment after passing through wastewater treatment plants. In this work, we develop a novel method to evaluate the presence of seven compounds in marine sediments and sewage sludges using microwave-assisted extraction followed by a clean-up step based in on-line solid phase extraction coupled to ultra-high-performance liquid chromatography with MS/MS detection. This method allows for fast and efficient extraction from the solid matrix, subsequent automatic on-line purification and preconcentration, and analysis. For the optimised method, LOD were from 53.3 to 146 ng/kg and LOQ were in the range of 176–486 ng/kg. The method was validated for different environmental solid samples with satisfactory recoveries and relative standard deviations, between 46.1 and 83.9 and 7.8 and 15.5% (sludges) and 50.1 and 87.1% and 8.83 and 16.3% (sediments), respectively. Finally, the studied analytes were quantified in concentrations between 0.18 and 24.0 ng/g in real samples of marine sediments and sewage sludges from Gran Canaria Island (Spain).