Here we report a strategy to synthesize efficient polymeric carbon nitrides/3D honeycomb poly(ionic liquid)s photoreactor. The initial parent polymeric carbon nitrides (PCN) were synthesized by sintering precursor formed by self-assembling molecules of cyanuric acid and melamine. Ionic liquids with polymerizable groups polymerized in situ with crosslinkers in a system dispersed in PCN to synthesize a photoreactor. Impressively, the obtained photoreactors have structurally stable nanoparticle morphology in a dry state and a transparent 3D network structure in a swelling state. Their successful formation, swelling ability and morphology were fully characterized by XRD, WAXS, FT-IR, SEM, XPS, TEM and N2 adsorption/desorption isotherm. UV–vis DRS, PL spectra, and photocurrent tests showed the improved photo-electric property of the photoreactor, which was attributed to the 3D network honeycomb structure improving the contact between the active centres in the reactor and the reaction substrate and the improving electron-hole separation efficiency of PCN by excellent electron transfer ability of poly(ionic liquid)s. These synthesized photoreactors could highly efficiently degrade the anionic dyes, such as methyl orange and acid blue 93, under a metal halide lamp or even natural sunlight.