Graphitized carbonitride (g-C3N4) is widely used in CO2 reduction, hydrogen production, and degradation of toxic chemical dyes and antibiotics. It is a kind of photocatalytic material with excellent performance, and it has the advantages of being safe and nontoxic, having a suitable band gap (2.7 eV), and having a simple preparation and high stability, but because of its fast optical recombination speed and low visible light overutilization, the multifunctional application of g-C3N4 is seriously hindered. Compared with pure g-C3N4, MWCNTs/g-C3N4 have a red-shift in the visible range and a strong absorption in the visible region. Melamine and carboxylated multiwalled carbon nanotubes were used as raw materials to successfully prepare CMWCNT modified g-C3N4 doped with P, Cl by a high temperature calcination method. The effect of the addition amount of P, Cl on the photocatalytic performance of modified g-C3N4 was studied. The experimental results show that the multiwalled carbon nanotubes can accelerate the electron migration, and the doping of P, Cl elements can change the energy band structure of g-C3N4 and reduce the band gap. Through fluorescence analysis and photocurrent analysis, it is known that the incorporation of P, Cl reduces the recombination efficiency of photogenerated electron-hole pairs. In order to explore the application in the degradation of chemical dyes, the photocatalytic degradation efficiency of RhB under visible light was studied. The photocatalytic performance of the samples was evaluated by photodecomposition of aquatic hydrogen. The results showed that when the amount of ammonium dihydrogen phosphate was 10 wt %, the photocatalytic degradation efficiency was the highest, which was 21.13 times higher than that of g-C3N4.