Large-scale extragalactic magnetic fields may induce conversions between very-high-energy photons and axionlike particles (ALPs), thereby shielding the photons from absorption on the extragalactic background light. However, in simplified ``cell{''} models, used so far to represent extragalactic magnetic fields, this mechanism would be strongly suppressed by current astrophysical bounds. Here we consider a recent model of extragalactic magnetic fields obtained from large-scale cosmological simulations. Such simulated magnetic fields would have large enhancement in the filaments of matter. As a result, photon-ALP conversions would produce a significant spectral hardening for cosmic TeV photons. This effect would be probed with the upcoming Cherenkov Telescope Array detector. This possible detection would give a unique chance to perform a tomography of the magnetized cosmic web with ALPs.