The remove of the organic pollutants in water plays an important role on the environmental protection, thus photocatalysis, as an effective method, has been attained much attention to deal with this problem. In this paper, a composite of g-C3N4 and Mg–Al hydrotalcite derived metal oxides was prepared by simple co-precipitation methods followed by calcination. The effective adsorption-photocatalysis synergic effect and highly efficient removal of organic pollutants from water under simulated sunlight irradiation was found in the presence of fabricated metal oxide nanocomposites. The photocatalytic degradation rate of methylene blue reached 97.3% within 1 h under visible light, and the degradation rate constant was 0.0432 min−1, which is 3.6 times that of g-C3N4. Though characterization analysis, more active sites are exposed to absorb more organic pollutants on the mater surface in the presence of the open hierarchical structures of composite materials, and the "face to face" contact structure between 2D materials is formed to promote the separation of electrons and holes. The photocatalytic degradation was stable in the recycling process of the catalyst. In addition, the photocatalytic degradation mechanism of the catalyst was explained by free radical scavenging experiment. The material provides an effective method for removing organic pollutants in water, and has broad application prospects.