The long-term risk of developing glaucoma after vitrectomy remains uncertain. This retrospective population-based cohort study aimed to explore this risk following vitrectomy for macular pucker or hole. Utilizing Taiwan's National Health Insurance Research Database (NHIRD), we included patients who were older than 18 years and had undergone vitrectomy surgery between 2011 and 2019. Exclusions were made for patients with prior diagnoses of glaucoma, congenital or secondary glaucoma, as well as those who had received previous vitreoretinal treatments or had undergone multiple vitrectomies. After an average follow-up period of 51 and 53 months respectively for the vitrectomized and non-vitrectomized group, our results showed a relative risk of 1.71 for glaucoma development in the vitrectomized group. Higher adjusted hazard ratios were also observed for open-angle glaucoma and normal tension glaucoma. Increased risks were associated with male sex, obstructive sleep apnoea, and migraine. In the subgroup analysis, phakic eyes at baseline and those who had undergone cataract surgery post-vitrectomy were associated with a lower risk of glaucoma development during follow-up. Among all glaucoma events, pseudophakic status at baseline had the shortest interval to glaucoma development following vitrectomy. These findings underscore the potential relationship between vitrectomy and glaucoma onset, emphasizing the need for vigilant monitoring and early detection of glaucoma in post-vitrectomy patients.