Coal elastic parameters are an important index reflecting the material composition and porosity, which can be used to guide reservoir evaluation and the safe mining of coal and coalbed methane. In this study, coal samples collected from coal seams #2, #3, #7 + 8 and #9 in the Yuwang colliery, eastern Yunnan, were studied, and the influences of organic matter, ash content and porosity on the elastic parameters of coal samples were investigated. The results show that the elastic parameters of coal are negatively correlated with organic matter content and porosity, and positively correlated with ash content. This means that the bulk modulus and primary‐wave velocity of coal decrease with a gradual increase in organic matter content or porosity and increase with a gradual increase in ash content. The main reason for this is that the ash modulus is typically higher than that of coal. When the ash content gradually increases, the contribution of ash to the equivalent modulus of coal increases, whereas the contribution of organic matter and pores decreases. In this study, the primary‐wave velocity of the target coal seam was fitted based on the generalized Gassmann equation. The calculation results were consistent with the observations and the relative error was within 7%. According to the distribution behaviour of elastic parameters, this provides adequate data support for the prediction of gas content in coal mines and ensures safe and green mining of coal resources.