With the vigorous development of the mariculture industry, the untreated wastewater from mariculture has exerted significant pressure on the water environment. The untreated N and P in the wastewater from mariculture can deteriorate the quality of the mariculture. In this study, a composite in situ treatment system involving macroalgae (Caulerpa lentillifera/Caulerpa sertularoides f. Longipes) and immobilized degrading bacteria was established to handle wastewater from shrimp culture. The changes in nutrients in aquaculture wastewater were studied by chemical analysis, and the microbial community structure was analyzed using molecular biology technology and high-throughput sequencing technology. The removal efficacy of nutrients in aquaculture wastewater and the composition of microorganisms in the wastewater were examined, and the primary causes for the alteration of the microbial community were analyzed. The results demonstrated that when the macroalgae in the system were Caulerpa lentillifera (CL), the removal efficiencies of TN, PO43--P, and COD from shrimp culture were 59.04%, 34.26%, and 68.61% respectively. When the macroalgae was Caulerpa sertularoides f. Longipes (CSF), the removal efficiencies of TN, PO43--P, and COD generated by experimental shrimp culture were 51.50%, 33.69%, and 50.88% respectively. The biomass (wet weight) of both macroalgae species also increased, facilitating the removal of nutrients from the wastewater. Additionally, both Proteobacteria and Bacteroidetes were the dominant bacteria in the three samples, and the addition of the composite in-situ treatment system had no impact on the dominant bacteria in the water. The results of FAPROTAX analysis indicated that compared with the untreated samples, the abundances of methyl-functional bacteria and amino acid-functional bacteria in the samples increased due to organic matter such as COD produced during shrimp culture and the addition of feed, suggesting that shrimp culture can influence the abundances of functional bacteria in the water. In conclusion, the combined in situ treatment system can effectively eliminate nutrients from aquaculture wastewater, and the combined effect of macroalgae and immobilized degrading bacteria plays a vital role in this process.