As a new nonmetallic photocatalysis material, it is of great attention to develop the carbon nitride (g-C3N4) with good structure and optical properties. Herein, a mesoporous g-C3N4 was prepared by molten salt-assisted silica (SiO2) aerogel template method, the properties of physicochemical and optical were characterized by X-ray diffraction (XRD), Fourier transform infrared spectroscopy (FT-IR), specific surface area and pore analysis, scanning electron microscopy (SEM), high-resolution transmission electron microscopy (HRTEM), X-ray energy spectrum (XPS), diffuse reflectance spectrum, fluorescence spectrum (PL) and zeta potential, respectively. Rhodamine B (RhB) was used for a series of adsorption and photocatalytic degradation experiments, and the reactive species and the degree of RhB degradation in the reaction process were tested by electron spin resonance (ESR) and UV–Vis absorption spectrum, respectively. The synergistic effect of adsorption and photocatalytic degradation was investigated. The results show that the mesoporous g-C3N4 was synthesized successfully, and presented a hollow tubular porous structure and good optical properties. With the highest specific surface area (164.65 m2·g−1) and narrower band gap (2.47 eV), the sample of M-CN-500 shown the highest degradation rate of RhB (90.9%) after 150 min illumination, and the adsorption capacity and zeta potential were both affected by pH variation. The kinetic model verified that the photocatalytic degradation rate of RhB by mesoporous g-C3N4 was enhanced with the synergistic effect of adsorption. It was also demonstrated that the O2− and h+ were the primary reactive species, and the RhB structure fracture was the main reason in the photocatalytic degradation. A mesoporous g-C3N4 was prepared by molten salt-assisted silica (SiO2) aerogel template method, and the synergistic effect of adsorption and photocatalytic degradation on this catalyst was investigated. Because of its special hollow tubular and porous structure, mesoporous g-C3N4 with high specific surface area can not only improve the adsorption performance, but also enhance the photocatalytic efficiency.