A novel photocatalyst comprising g-C3N4/NiAl-layered double hydroxide (LDH)/CeO2 nanocomposites were synthesized via a straightforward hydrothermal method. Rhodamine B (RB) was employed as a model dye to assess the degradation efficiency of the nanocomposites. The catalytic efficiency of the synthesized ternary nanocomposites was compared with of dual g-C3N4/NiAl-LDH and NiAl-LDH/CeO2 nanocomposites. The pristine photocatalysts were subjected to characterization through X-ray diffraction (for crystallinity), field emission scanning electron microscopy and transmission electron microscopy (for microstructure), thermogravimetry analysis (for thermal stability) and X-ray photoelectron spectroscopy (for composition and chemical bondings). UV–visible diffuse reflectance spectroscopy were used for energy band gap calculations. Results demonstrated the successful formation of g-C3N4/NiAl-LDH/CeO2 3D nanocomposite by bridging g-C3N4 and CeO2. The resultant g- C3N4/NiAl-LDH/CeO2 composite exhibited superior photocatalytic activity compared to bare NiAl-LDH, CeO2, and g-C3N4/NiAl-LDH and LDH/CeO2 nanocomposites, achieving a degradation efficiency of 98% for RB under UV irradiation after 350 min. A broader range of absorption (from UV to visible light) was achieved for ternary nanocomposite. A plausible mechanism was proposed based on the observed results and the kinetic of degradation was studied.