Cetyltrimethyl ammonium bromide (CTAB) was used as template agent to prepare porous cerium titanate by sol–gel method. Besides major brannerite CeTi2O6 in monoclinic system, the addition of CTAB template leads to formation of minor anatase TiO2 and CeO2 phases. FT-Far-IR spectra also prove Ce-O and Ti-O-Ti bonds in the porous cerium titanate. The addition of CTAB template in the precursor can obviously enlarge BET surface area and pore volume of cerium titanate. Removal of CTAB template during calcination leaves mesoporous structure in the cerium titanate samples, which are presented in the N2 adsorption-desorption isotherms. Not only more hydroxyl radicals can be produced on the samples obtained using CTAB, but also photocatalytic oxidation efficiency is strongly influenced by the variation of CTAB amount. The reaction rate constant is 2.44 × 10−2 min-1 on the porous cerium titanate sample obtained using 2 g CTAB, while the reaction rate constant is only 9.60 × 10−3 min-1 on the sample without CTAB. UV-Visible spectra of ofloxacin solution during photocatalytic oxidation demonstrate the degradation of typical organic groups in ofloxacin molecule.