Anaerobic fermentation is a potentially cost-effective approach to disposing of metal-contaminated biowaste collected during phytoremediation. However, the compound heavy metals contained in the biowaste may limit the efficiency of anaerobic fermentation. In this study, anaerobic fermentation with alfalfa harvested from an iron tailing as the feedstock was set up and further enhanced by granular activated carbon (AC). The results showed that adding AC improved the cumulative biogas yields of alfalfa contaminated with metals (AM) by 2.26 times. At the biogas peak stage, plenty of microbes were observed on the surface of the AC, and the functional groups of AC contributed to better electron transfer, lower heavy metal toxicity and higher CH4 contents. AC increased the richness and decreased the diversity of bacteria while reducing both the richness and diversity of archaea. The AC addition resulted in higher relative abundance of Prevotella_7, Bacteroides and Ruminiclostridium_1, which enhanced the hydrolysis of substrate and produced more precursors for methanogenesis. Meanwhile, the relative abundances of Methanosarcina and Methanobacterium were remarkably increased together with the metabolism of cofactors and vitamins, indicating the enhancement of both the acetoclastic and hydrotrophic methanogenesis. The present study provided new insights into the microbial responses of the anaerobic fermentation in heavy-metal-contaminated plants and proved the possibility of enhancing the biogas production by AC.