The very strong negative thermal expansion in the porous aluminophosphate AlPO4-17 with a hexagonal erionite structure was tuned by the insertion of oxygen molecules at high pressure. The structure of the oxygen-filled material was determined in situ at high pressure by synchrotron, single-crystal X-ray diffraction. The thermal expansion of this material was measured precisely at 0.38 GPa by synchrotron X-ray powder diffraction. Whereas the overall volume thermal expansion only exhibits a small change with respect to empty AlPO4-17 at ambient pressure, the expansion along the a direction decreases almost to zero and the expansion along c increases by a factor of 7. Such highly anisotropic thermal expansion properties are of great interest for mechanical and optical applications as in two directions the dimensions of the material are extremely stable, whereas a very strong linear negative thermal expansion of -2.2 × 10-5 K-1 is observed in the perpendicular direction. Guest insertion is thus a very powerful tool for tuning the thermal expansion properties of porous materials.