The environmental impact of dyes as significant water pollutants has prompted increased attention. Photocatalytic processes have emerged as a potential solution for eliminating organic pollutants from wastewater. However, widespread industrial application faces challenges such as the high production cost of photocatalysts, difficulties in enhancing their efficiency, and concerns related to reusability. This study focuses on synthesizing a TiO2/Fe3O4 nanocomposite using an ionic liquid to modify the TiO2 structure, reduce the energy band gap, and improve photocatalyst recoverability through a magnetic field. Incorporating various percentages of iron into the photocatalyst using ionic liquid as both a solvent and modifier, the study employed XRD, FT-IR, FE-SEM, EDX, BET, and DRS analyses. Results highlighted the significance of the anatase and crystalline phases and the use of iron oxide (II-III) in influencing photocatalytic performance. Operational parameters were investigated, including pollutant concentration, catalyst concentration, pH, water type, and light source. Active species generated during photocatalytic degradation, such as trap holes and free radicals, were identified through various scavenger tests. The findings underscore the significant potential of this nanocomposite for visible light photocatalytic degradation, achieving notable removal efficiencies under different operational conditions, including 85 % under tungsten halogen lamp light and 92 % under sunlight.