Although photosensitization of titania by organic dyes is one of the conventional ways for visible-light utilization of titania, previous studies have not yet addressed the use of dyes as templates in the synthesis of mesoporous materials, let alone the simultaneous achievement of highly crystalline mesoscopic ordering and visible-light photocatalytic activity. In this work, fourteen commercial synthetic dyes were directly used as structure-directing agents which convert to carbonaceous materials after 400 °C calcination in synthesis of thermally stable mesostructured titania. This in situ carbon enhanced the visible light photocatalytic activities for the degradation of aqueous dyes. The synthesized mesoporous titania samples were characterized by a combination of various physicochemical techniques, such as XRD, SEM, HRTEM, nitrogen adsorption/desorption, TGA–DSC, XPS, diffuse reflectance UV–vis and FT–IR. Most of prepared mesoporous titania photocatalysts exhibited better activity under outside solar light than under artificial UV light, due to the presence of carbonaceous species which were transferred from the dye templates. The reported strategies combine sol-gel chemistry and self-assembly routes directly using dye templates that tune the material's architecture, texture and particularly function, visible-light photocatalysis.