In the present work, the Fe3O4@SiO2@TiO2 and Ag/Fe3O4@SiO2@TiO2 nanocomposite has been successfully synthesized and developed as a highly efficient heterogeneous photocatalyst for the removal of methyl orange (MO) as a representative model of organic pollutants in water. The nanocomposites were characterized extensively by techniques such as x-ray diffraction, scanning electron microscopy, transmission electron microscopy, energy-dispersive x-ray spectroscopy, ultraviolet–visible light (UV–VIS) diffuse reflectance spectroscopy, vibrating sample magnetometer, Brunauer–Emmett–Teller surface area analysis and Fourier transform infrared spectroscopy. Degradation of MO, being an indication of photocatalytic activity, was optimized as the response using the response surface methodology combined with the central composite design based on designing runs. The molar ratios of cetyltrimethylammonium bromide (CTAB), tetraethyl orthosilicate (TEOS) and titanium(IV) isopropoxide (TTIP) to Fe3O4 have been used as variables. The optimum conditions were found to be at 0.33, 2.47 and 7.53 molar ratios for CTAB, TEOS and TTIP, respectively. The photocatalytic degradation efficiency of MO using the Fe3O4@SiO2@TiO2 nanocomposite photocatalyst synthesized under the optimum parameters reached 74%. Afterwards, we deposited Ag nanoparticles on the surface of the optimum sample through the photodeposition method and thus enhanced the efficiency of degradation under visible and UV irradiation to 84% and 98%, respectively. The catalysts are easily recoverable by an external magnetic field.