The Ag3PO4/CoFe1.95Y0.05O4nanocomposite with magnetic properties was simply synthesized by the hydrothermal method. The structure and morphology of the prepared material were characterized, and its photocatalytic activity for degradation of the methylene blue and rhodamine B dyes was also tested. It was revealed that the Ag3PO4in the nanocomposite exhibited a smaller size and higher efficiency in degrading dyes than the individually synthesized Ag3PO4when exposed to light. Furthermore, the magnetic properties of CoFe1.95Y0.05O4enabled the nanocomposite to possess magnetic separation capabilities. The stable crystal structure and effective degradation ability of the nanocomposite were demonstrated through cyclic degradation experiments. It was shown that Ag3PO4/CoFe1.95Y0.05O4–0.2 could deliver the highest activity and stability in degrading the dyes, and 98% of the dyes could be reduced within 30 min. Additionally, the photocatalytic enhancement mechanism and cyclic degradation stability of the magnetic nanocomposites were also proposed.