Porous N-doped TiO2 photocatalyst was successfully synthesized by an environmentally friendly peroxo sol-gel method using polyethylene glycol (PEG) as a templating agent. Here, the effect of PEG addition to the aqueous peroxotitanium solutions on the structure, pore properties and photocatalytic activity of the obtained photocatalysts was systematically studied. The prepared photocatalysts were characterized by X-ray diffraction (XRD), UV-Vis diffuse reflectance spectroscopy (DRS), and Brunauer-Emmett-Teller (BET). It was found that the doping of nitrogen narrows the band gap of TiO2 leading to enhance its visible-light response. The BET analysis shows that the prepared photocatalysts have a typical mesoporous structure with pore sizes of 3–6 nm. The photocatalytic activity of the prepared photocatalysts was evaluated by photocatalytic reduction of Cd(II) in an aqueous solution under visible light irradiation. The results show that porous N-doped TiO2 with the optimal PEG addition had the highest Cd(II) reduction of 85.1% after 2.5 h irradiation in neutral aqueous solution. This significant improvement in photocatalytic activity of the prepared photocatalysts was mainly attributed to the synergistic combination of N doping and porous structure, which could actively increase the catalytic active site of this photocatalysts. Copyright © 2021 by Authors, Published by BCREC Group. This is an open access article under the CC BY-SA License (https://creativecommons.org/licenses/by-sa/4.0).