g‐C3N5 has wide‐ranging applications in photocatalysis owing to its two‐dimensional layered structure, large surface area, and small band gap. In this study, the surface of g‐C3N5 was subjected to inorganic acid modification and combined with BiOCl to form a heterojunction, effectively improving the photocatalytic activity of the material. The rates of degradation of rhodamine B and ciprofloxacin by the 15‐C3N5‐BiOCl composite photocatalyst were 22.2 and 20.7 times higher, respectively, than those of degradation by g‐C3N5. This was attributed to the Z‐type heterojunction formed by g‐C3N5 and BiOCl, which significantly improved the efficiency of photogenerated electron–hole pairs separation and broadened the optical response range. The preparation of novel photocatalysts has broad application prospects in the treatment of organic pollutants in water. [ABSTRACT FROM AUTHOR]