Preventing the propagation of flames in a pipeline is an effective measure for avoiding gas explosion accidents and reducing losses. To evaluate the effect of wire mesh, acting as a porous media, experimental and simulation studies are conducted to determine the influence of the wire mesh on the dynamics of premixed methane/air flame propagation in a semi-closed pipe. Four different kinds of wire mesh with different numbers of layers are chosen in the experiments and simulation, and the mechanism of wire mesh quenching of the flame is investigated. The experimental and simulation results are consistent. Flames are quenched when 4 layers of 40-mesh or 3 layers of 60-mesh wire mesh are used; however, once the flame propagates through the wire mesh, the risk of methane combustion may increase. The wire mesh becomes the key factor causing flame folds and acceleration, and the greater the number of layers or the larger the mesh size is, the more obvious the folds after the flame passes through the wire mesh. Moreover, the combination of heat absorption and disruption of the continuous flame surface by the mesh causes flame quenching. Wire mesh can effectively attenuate the flame temperature during premixed flame propagation in a pipe, and the attenuated maximum rate reaches approximately 79% in the case of adding 3 layers of 60-mesh wire mesh.