Synthesizing efficient catalysts to degrade hazardous pollutants in wastewater, especially in alkaline conditions, is pivotal for water remediation. A magnetically separable Z-scheme FeSiB metallic glass (MG)/g-C3N4 photocatalyst with high activity under visible-light irradiation is prepared via ball milling. The photocatalyst exhibits a sufficient degrading capability to acid orange 7 (AO7) in acidic, neutral and alkaline solutions, and also shows excellent reusability. The photocatalytic efficiency of the composite can be optimized by modifying the weight ratio of FeSiB MG and g-C3N4 powders. Heterojunction structure is formed at the interface of g-C3N4 and FeSiB MG due to the shearing stress from ball milling, leading to the improvement of the separation efficiency of the photo-generated electron-hole pairs. This results in the enhancement in photocatalytic activity for the composite. Besides, the FeSiB MG/g-C3N4 photocatalyst can be recycled from solution conveniently due to their high saturation magnetization. This study offers a magnetically separable photocatalyst that can degrade azo dyes at universal pH conditions.