An environmentally benign procedure for the preparation of polyaniline/TiO2 composites is presented. The UV irradiation-induced synthesis leads to materials with good crystallinity and tailored morphology, showing promising sorption and recycle properties in dye removal tests. A reaction mechanism is proposed on the basis of LC-MS and FT-IR investigations.