Polyethylene glycol templates with different molecular weight were used to synthesize samarium titanate and to improve the porous structure in samarium titanate. The aggregation of Sm2Ti2O7 particles during calcination was strongly prohibited after using polyethylene glycol, and the cell volume of Sm2Ti2O7 crystals was also apparently reduced. There was a reducing tendency in the lattice parameters with decreasing chain length of polyethylene glycol. The bandgap energies for Sm2Ti2O7, Sm2Ti2O7(PEG600), Sm2Ti2O7(PEG2000), Sm2Ti2O7(PEG4000) and Sm2Ti2O7(PEG10000) were calculated to be 3.41, 3.78, 3.74, 3.80 and 3.82 eV, respectively. The lowest photoluminescence intensity was obtained for Sm2Ti2O7(PEG2000), showing the smallest recombination efficiency for the charge carriers. PEG could apparently enlarge the specific surface areas and the pore volumes of Sm2Ti2O7(PEGn), and the maximum values were obtained for Sm2Ti2O7(PEG2000). The molecular weight of PEG had strong influence on the activity of the materials. Sm2Ti2O7(PEG2000) had the strongest activity, and the Reactive Brilliant Red X-3B solution was entirely decolorized after 120 min of reaction. Sm2Ti2O7(PEG2000) could be reused to treat the dye with a slight decrease in degradation efficiency.