A facile and sensitive PEC sensor for the detection of 4-CP was first fabricated. The Au/g-C3N4 composites were synthesized by reducing Au(III) on the protonated g-C3N4. Synergistic effect between Au and g-C3N4 contributed to the high PEC performance. The facile PEC sensor exhibited outstanding performances for 4-CP detection.