Metal−organic framework (MOF) glasses have multiple potential applications, as they combine advantages of traditional glasses with those of MOFs. The melt-quenching process used to form MOF glasses typically leads to a significant decrease in porosity, but the structural origin of this thermally induced pore collapse remains largely unknown. Here, we study the melting process of three zeolitic imidazolate frameworks (ZIFs), namely ZIF-4, ZIF-62, and ZIF-76, using ab initio molecular dynamics (MD) simulations. By analyzing the MD data using topological data analysis, we show that while the three ZIF systems exhibit similar short-range order structural changes upon heating, they exhibit significant differences in their medium-range order structure. Specifically, ZIF-76 retains more of its medium-range order structures in the liquid state compared to the other glass-forming ZIF systems, which allows it to remain more porous than ZIF-4 and ZIF-62. As such, our results may aid in understanding the structural features that govern the ability to maintain porosity in the melt-quenched glassy state.