As the mesoporosity is directly dependent on the change of the amorphous structure, heated Mg-and Ni-struvite differ significantly in their absolute and temporal evolution of mesoporous frameworks. Primarily, isolated pores form in the course of removal of mainly water and, to a minor extent, ammonia. In the initial degassing step, barely any reconfiguration occurs in the compound, which results in a polydisperse population of larger mesopores (> 10 nm for Mg, > 20 nm for Ni) and micropores. Upon further heating, majorly the building units, PO4 and MO6 begin probably to bind to each other causing a potential shrinkage of the pores (disappearance of larger mesopores), as implied by the structures in XAS. Minorly the isolated ammonium unit decomposes partly to ammonia, and such released protons could form, in combination with oxygen, free water as a condensation product. As the bond distances were just evaluated exsitu with EXAFS, the dynamic reconfiguration process of the compound is likely to be more far more complex. At final t = 5500 s, Mg-and Ni-struvite exhibit bimodal distributions of pores: a single microporous population of around 1 nm, one other mesoporous population at around 8±1 nm for Mg and 14±4 nm for Ni. We assume that the isolated micropores begin to partly coalesce to mesopores 5-15 nm in size, and we speculate that channel/worm-like, elongated geometries (5-15 nm) of pores also evolve. Such a geometry would explain the pore interconnectivity. The shape of pores has to be further confirmed, and this geometry is not explicitly included in our scattering model due to its mathematical constraints. However, in Mg-struvite these channel-like/elongated pores, if actually present, seem to form fast and gradually increase with higher heating time (progressive increasing intensity of main peak at around q = 0.7-0.8 nm -1 ). Therefore, the relative volume fraction of mesopores is much higher than the one of micropores (approximately for Mg: φmicropores ≈ 83% to φmesopores ≈ 17%). Uniform and narrow pore size distributions of 8±1 nm and 1.0±0.5 nm develop through time.