Rare-earth ultraphosphate (RP 5 O 14) framework materials are potential host media for nuclear waste storage, since cages within their nanoporous structures have volumes that match well those of prospective guests such as uranium or plutonium ions. Good volume matches of host cages and guest compounds are nonetheless not the only structural requirement for ensuring viable nuclear waste storage. Host structures also need to be stable enough to withstand the typical environmental conditions of long-term storage of spent nuclear fuel. To this end, the nanoporous cage topologies of neodymium and gadolinium ultraphosphate, NdP 5 O 14 and GdP 5 O 14 , are investigated as a function of temperature. Topological analysis shows that, while both compounds are essentially isostructural, thus displaying the same type of cage structures, the cage volumes of NdP 5 O 14 are significantly larger than those of GdP 5 O 14 , with one stark exception. This exception concerns the smallest cage of NdP 5 O 14 , whose 8/4 topology lacks structural cross-linking that would otherwise give it much more strength. This 'squashed' cage appears to owe its origins to the specific nature of crystallogra phic twinning in NdP 5 O 14 , which causes strain that needs alleviating; squashing the 8/4 cage in NdP 5 O 14 would be the most susceptible option towards this end, since its cage manifests the weakest structural construct. GdP 5 O 14 succumbs to a gradual contraction of its 8/4 cage only with increasing temperature above 300 K; this is well below its second-order monoclinic-toorthorhombic phase transition at 420-430 K; which is 420 K for NdP 5 O 14. Fortunately, the volumes of heavy metal ions that arise from spent nuclear fuels do not match the size requirements of cages with 8/4 topology in RP 5 O 14 hosts needed for encapsulation; otherwise, radiation leakage of such containment would present a risk. Both NdP 5 O 14 and GdP 5 O 14 would therefore seem to offer good prospects as host media for nuclear waste storage.