In view of the problems of antibiotic pollution, anaerobic fermentation technology was adopted to remove erythromycin in this study. The removal of erythromycin and its effects mechanism on anaerobic fermentation were studied, including biogas performance, process stability, substrate degradability, enzyme activity, and microbial communities. The results showed that the removal rates of erythromycin for all tested concentrations were higher than 90% after fermentation. Erythromycin addition inhibited biogas production. The more erythromycin added, the lower the CH4 content obtained. The high concentration of erythromycin (20 and 40 mg/L) resulted in more remarkable variations of pH values than the control group and 1 mg/L erythromycin added during the fermentation process. Erythromycin inhibited the hydrolysis process in the early stage of anaerobic fermentation. The contents of chemical oxygen demand (COD), NH4+–N, and volatile fatty acids (VFA) of erythromycin added groups were lower than those of the control group. Erythromycin inhibited the degradation of lignocellulose in the late stage of fermentation. Cellulase activity increased first and then decreased during the fermentation and addition of erythromycin delayed the peak of cellulase activity. The inhibitory effect of erythromycin on the activity of coenzyme F420 increased with elevated erythromycin concentrations. The relative abundance of archaea in erythromycin added groups was lower than the control group. The decrease in archaea resulted in the delay of the daily biogas peak. Additionally, the degradation rate of erythromycin was significantly correlated with the cumulative biogas yield, COD, pH, and ORP. This study supports the reutilization of antibiotic-contaminated biowaste and provides references for further research.