Blending hydrogen into existing natural gas pipelines is a cost-effective method for large-scale hydrogen transportation. However, high hydrogen ratios cause hydrogen embrittlement in pipeline steel, limiting transportation efficiency. Due to complex structures and harsh application conditions, existing coatings are difficult to apply on pipelines. To tackle such issues, we propose an ionic liquid-polymer composite coating using epoxy resin as coating substrate, based on the competitive adsorption of methane and hydrogen on pipeline steel. Ionic liquids with high methane selectivity were selected via quantum chemical calculation. The protective effect of coatings was characterized using hydrogen pre-charging constant strain tensile tests. Simulation and experimental results demonstrate that epoxy resin coatings reduce hydrogen embrittlement in X80 steel. Modified with selective CH4/H2 permeability ionic liquids, the epoxy resin coating enhances methane and hydrogen competitive adsorption on the steel surface, improving hydrogen embrittlement resistance. This novel coating offers a viable solution for achieving safe and high ratio hydrogen blended transportation in natural gas pipeline.