A Z‐scheme WO3/g‐C3N4 heterojunction is fabricated by adopting melamine and ammonium tungstate as the precursor by calcination and a simple in situ growth method. The morphology, structure, optical properties, and degradation efficiency of Z‐scheme WO3/g‐C3N4 heterojunctions are investigated in this paper. The photocatalytic experiments indicate that WO3/g‐C3N4 (5 wt%) has the fastest degradation rate of tetracycline (TC) and rhodamine B (RhB) under light conditions. Furthermore, the properties of WO3/g‐C3N4 (5 wt%) are also assessed according to the degradation velocity of RhB and TC by the photo Fenton‐like experiment, respectively within 30 min. A 96% RhB removal and a 76% TC removal are recorded after 30 min of photo Fenton‐like reaction, which has a big improvement of degradation velocity over photocatalytic experiments. During the calcination of ammonium tungstate, water vapor and ammonia gas are removed to promote the composition of porous structures of WO3/g‐C3N4, which is a remarkable contributor to enhancing the specific surface area and reactive activity sites. The porous structures obtained by calcination and Z‐scheme heterojunction constituted by the combination of g‐C3N4 and WO3 synergistically promote the improvement of photocatalytic activity.