We study compressibility effects on pressure fluctuations in wall-bounded turbulent flows using DNS data of compressible turbulent channel flows at various Mach numbers. We derive a pressure Poisson equation that allows splitting pressure fluctuations into the following terms: the rapid and slow terms as in incompressible flows, an additional mass-flux term related to the temporal and spatial variation of mass-flux fluctuations, and a viscous term related to fluctuating viscous stresses. As the bulk Mach number increases, the intensity of pressure fluctuations increases in the viscous sublayer and in the outer region, resulting from the intensification of the mass-flux term, whereas it decreases in the buffer layer and logarithmic layers, after weakening of the slow term. The rapid and slow terms are further split into their solenoidal and dilatational components using Helmholtz decomposition. The variances of the solenoidal components are found to be independent of the Mach number, whereas the dilatational components increase quadratically with the Mach number. The correlations between split pressure fluctuations and dilatational fluctuations show that the solenoidal-related pressure field turns turbulent kinetic energy into internal energy, whereas dilatational and viscous terms are responsible for reverse energy transfer.