Photocatalytic CO2 reduction to hydrocarbon fuels represents a promising solution to CO2 emission challenges. However, photocatalytic CO2 reduction systems face hurdles in practical utilization for the low efficiency of photocatalysts and challenge in catalyst immobilization. Therefore, a novel monolithic three-dimensional Z-scheme photocatalyst was synthesized by fabricating Bi2WO6/g-C3N4 heterojunction on Cu foam substrate (Bi2WO6/g-C3N4/Cu foam) via thermal polymerization and electrophoresis deposition. A series of characterization results, including X-ray diffraction, Fourier transform infrared spectroscopy, X-ray photoelectron spectroscopy, scanning electron microscopy and N2 adsorption–desorption, illustrate the crystalline properties, pore structure, and morphology of the composite photocatalyst. Consequently, Bi2WO6/g-C3N4/Cu foam achieved CO production yield of 33.84 μmol/g cat under visible light illumination for 6 h and retained 96.2 % of initial photocatalytic activity after 30 h of reaction. UV–Vis diffuse reflection spectra, photoluminescence spectra and photoelectrochemical analysis was involved to reveal the mechanism of the photocatalytic activity of composite photocatalyst.The synergistic effect of the Z-scheme mechanism and the hierarchical macroporous structure improves the light absorption, light-induced electron-hole pair separation, and charge transmission. This catalyst construction strategy provides a viable approach for facilitating practical photocatalytic CO2 reduction.