The g‐C3N4 decorated porous gallium phosphide have been fabricated by a facile electrophoretic deposition (EPD) process. The morphology, element composition and light absorption of the GaP/g‐C3N4photoanode were observed using field‐emission scanning electron microscopy, X‐ray photoelectron spectroscopy, ultraviolet and visible spectrophotometer, respectively. When acting as photoanode, porous GaP/g‐C3N4 serves as a direct Z‐scheme system, where photogenerated holes in GaP are expended by electrons generated from the g‐C3N4, inhibiting the corrosion of GaP. Therefore, the porous GaP/g‐C3N4 showed a larger photocurrent density, which is 2.1 times as large as that of the porous GaP without g‐C3N4, and a more stable photocurrent density for over 10000 s (at 0 V vs RHE). Thus, this work delivers a practical way to improve the photoelectrochemical stability and property of III‐V semiconductor materials, which could be used in solar energy conversion fields.