An azo dye, Reactive Black 5 (RB5), was degraded by three photocatalysts of g‐C3N4, Ag(2 %)/g‐C3N4, and Ag(5 %)/g‐C3N4 with the specific surface areas of 34.41, 28.70, and 35.58 m2 g−1 and the band gaps of 2.52, 1.56, and 1.71 eV under sunlight illumination, respectively. The results showed 40 mg/L of g‐C3N4 could degrade completely 10 ppm RB5 at pH 3.4 within 10 min under sunlight irradiation with the first‐order rate constant of 0.312 min−1. Under the same conditions, the complete degradation time of RB5 reduced to 5 and 7 min when the plasmonic nanocomposites of Ag (2 %)/g‐C3N4 and Ag (5 %)/g‐C3N4 were used as photocatalysts, respectively. Ag content had an important influence on the photocatalytic activity of g‐C3N4 against RB5 so that Ag (2 %)/g‐C3N4 possessed the best photocatalytic efficiency with the rate constant of 0.795 min−1. In fact, Ag nanoparticles through the surface plasmon resonance effects and by accepting the photogenerated electrons could improve the visible‐light absorption and increase charge separation of g‐C3N4. The results showed superoxide radical is the main oxidant in the photodegradation of RB5.