A novel room-temperature method for the preparation of porous TiO2 films with high performance in dye-sensitized solar cells (DSSCs) has been developed. In this method a small amount of TiIV tetraisopropoxide (TTIP) is added to an ethanolic paste of TiO2 nanoparticles, where it hydrolyzes in situ and connects the TiO2 particles to form a homogenous and mechanically stable film of up to 10 μm thickness without crack formation. Residual organics originating from the TTIP were removed by UV–ozone treatment of the films, leading to a remarkable improvement of the cell efficiency. Intensity-modulated photocurrent/voltage spectroscopy (IMPS/IMVS) showed that the main effect of the UV–ozone treatment is to suppress the recombination of photogenerated electrons, thereby extending their lifetime. The efficiency was further increased by preheating the TiO2 nanoparticles before the paste preparation to remove contaminants originating from the preparation process of the particles. Solar-to-electric energy conversion efficiencies of 4.00 and 3.27 % have been achieved for cells with conductive glass and plastic film substrates, respectively, under illumination with AM 1.5 (100 mW cm–2) simulated sunlight.