Herein we outline a facile and viable approach for successful anchoring of ZnWO4 and Fe3O4 nanoparticles on graphitic carbon nitride (g-C3N4) through ultrasonication and microwave irradiation. The as-synthesised nanocomposite, g-C3N4–Fe3O4–ZnWO4, was characterised using Fourier transmission infrared spectroscopy, X-ray diffraction, scanning electron microscopy, energy-dispersive X-ray spectroscopy, transmission electron microscopy, vibrating-sample magnetometry, and X-ray photoelectron spectroscopy techniques. The nanocomposite exhibited appreciable catalytic performance in the Claisen–Schmidt condensation reaction between benzaldehyde and acetone producing dibenzalacetone with excellent yields. The as-prepared catalyst demonstrated excellent magnetically recyclable property for seven successive runs. The presence of g-C3N4 in the nanocomposite g-C3N4–Fe3O4–ZnWO4 played a significant role in promoting the catalytic activity due to its inherent basic nature and efficient grafting of the substrates onto the g-C3N4 sheets.