Sustained casing pressure (SCP) was an urgent problem to be solved during shale gas exploration and development. To cope with the issue of SCP, a method of establishing gas channeling barrier was proposed, and the location of the barrier was optimized, considering engineering and geological factors. A series of tests, containing uniaxial/triaxial compression tests and cyclic loading-unloading tests, were carried out to evaluate the accumulated plastic strain. Also, a full-scale cement sheath sealing integrity evaluation device was employed to verify the appearance of the micro-annulus. Computed tomography scan and nuclear magnetic resonance tests were performed to measure and analyze the distribution of microcracks and pores in the cement sheath after cyclic loading-unloadings. Numerical models of the wellbore assembly were established, which considered wellbore structures of different intervals of an actual deep shale gas well. Research findings indicated that after loading and unloading a certain number of times, the accumulation of plastic strain showed an increasing trend with the increase of the measured depth in the vertical section, but decreased with the rise of the measured depth in the horizontal section. The method of setting gas channeling barrier was proposed and could be used to avoid SCP by using the cement slurry with low elastic modulus, which could significantly reduce the cost of cementing operation. Many factors, including the non-uniform in-situ stress, wellbore structure, fracturing stage number, casing internal pressure, and formation mechanical properties were considered to establish the optimization method of barrier locations, and this method was verified by using the logging data of an actual well as well as the engineering and geological data. • An optimization method of establishing gas channeling barrier was proposed. • Loading-unloading of inner pressure leads to porosity increase of cement sheath. • First barrier should be established far away from the heel. Fig. 8 displays the gas leakage measurement results. As observed, gas leakage was detectable in the 22nd cycle at the injected gas pressure of 5 MPa. The gas channeling rate also increased as the injection pressure elevated. In order to observe which interface failed, the annulus was photographed, as presented in Fig. 9 . Obviously, micro-annulus appears at the inner surface of the cement sheath without internal cracks following repeated loading/unloading cycles. The obtained results show that the micro annulus mainly occurs in the inner interface of cement sheath.