Composite materials include various components with different structures, which cooperatively increase their properties and extend their application. In this study, the graphitic carbon nitride (g-C3N4) guest material was assembled into the porous of the SiO2 aerogel, which was prepared during the gel process. By this way, the g-C3N4 could be absolutely encapsulated into the porous of the disordered porous SiO2 aerogel. The prepared g-C3N4/SiO2 composite had a loose porous structure and exhibited the much higher photocatalytic activity to the photodegradation of rhodamine B (RhB) under visible light. The disordered porous structure enhanced photocatalytic activity, and the degradation rate reached to 96.42% in 90 min under the irradiation of visible light, which could be attributed to its high surface area and effective electron–hole separation rate. The catalyst had the much higher stability and could be easily recycled utilization. The prepared composites could be applied to degrade organic pollutants in wastewater.