With a lattice Boltzmann two-phase flow model with large density ratio, we study dynamic behavior of a bubble as it passes through a porous media. It was found that as the porosity is large, the bubble deforms without breaking, and it passes completely through the porous medium; As the porosity is small, the bubble deforms violently and ruptures, and it takes more time to pass through the porous medium. In addition, as the contact angle of the porous medium is small, the bubble passes completely through the porous medium; As the contact angle increases, the bubble begins to rupture; The larger the contact angle is, the more seriously the bubble ruptures. The residual mass of the bubble decreases with the increasing of the contact angle. Moreover, it shows that as Eotvos number (Eo) increases, the proportion of surface tension decreases; The bubble ruptures more seriously; And the residual mass of the bubble passing through the porous media is smaller. It is found that the influence of wettability on residual mass of the bubble is the most obvious, and the influence of Eo is the minimum.