A heterogeneous nanocomposite (NC) of g-C3N4/W18O49 based on the coupling of W18O49 nanorods (NRs) with the graphitic carbon nitride (g-C3N4) sheets has been synthesised via a solvothermal method. The as-synthesised products were characterised by X-ray diffraction, X-ray photoelectron spectrometry, and transmission electron microscopy. The g-C3N4/W18O49 NC exhibited very strong adsorption ability towards the methylene blue (MB) dye and demonstrated a high removal efficiency of 99.14% after 0.5 h equilibration in dark. Compared to the g-C3N4 sheets and W18O49 NRs, the g-C3N4/W18O49 NC exhibited higher removal efficiencies towards both the MB and methyl orange (MO) dyes via a combination of adsorption and degradation. The photocatalytic process of the g-C3N4/W18O49 NC followed the Z-scheme photocatalytic mechanism. This work provides an efficient strategy for the synthesis of g-C3N4-based heterogeneous photocatalysts.