Discharged sewage is the dominant source of urban river pollution. Macrolide antibiotics have emerged as prominent contaminants, which are frequently detected in sewage and rivers and pose a threat to aquatic microbial community. As a typical primary producer, periphyton is crucial for maintaining the biodiversity and functions of aquatic ecosystem. However, effects of antibiotic exposure time as well as the recovery process of periphyton remain undetermined. In the present study, five exposure scenarios of two typical macrolides, erythromycin (ERY) and roxithromycin (ROX) were investigated at 50 µg/L, dose to evaluate their potential detrimental effects on the structure and function of periphyton and the subsequent recovery process in 14 days. Results revealed that the composition of periphytic community returned to normal over the recovery period, except for a few sensitive species. The antibiotics-caused significant photodamage to photosystem II, leading to continuous inhibition of the photosynthetic capacity of periphyton. Furthermore, no significant difference in carbon metabolism capacity was observed after direct antibiotic exposure, while the amine carbon utilization capacity of periphyton remarkably increased during the recovery process. These results indicated that periphyton community was capable of coping with the periodic exposure of antibiotic pollutants and recovering on its own. However, the ecological functions of periphyton can be permanently disturbed due to macrolide exposure. Overall, this study sheds light on the influence of macrolide exposure on the development, structure and function of the periphytic microbial community in rivers.