We have developed a variety of optical fibers with holes enclosing the core to increase the service life of fiber optic devices under high-temperature and high-pressure environments by blocking the diffusion of dopants in the core with the help of air holes. Simulation results show that the fiber with uniformly distributed holes enclosing the core, the more the hole number, the smaller the core hole distance, and the larger the hole radius, the more significant the blocking effect on thermal diffusion. By comparing the refractive index distribution of three kinds of holes enclosing core fibers and single-mode fibers after prolonged high-temperature heating treatment, the thermal diffusion blocking effect of the holes enclosing core fiber is verified. Long-period fiber gratings fabricated by periodic refractive index modulation of holes enclosing core fibers can realize the measurement of various physical parameters. The thermal diffusion blocking effect of the holes enclosing core fiber enables the long-period fiber grating devices to work for a long time under high-temperature and high-pressure environments, showing the potential for practical applications in various industrial processes.