A correction model is presented for sensor-size-related high-frequency attenuation when measuring the wall pressure fluctuations beneath turbulent boundary layers. The model is developed based on the wall pressure spectra measured on a flat plate model, using sensors of different sizes and types. The measurement covers the range of Reynolds numbers, $Re_\theta$, based on the momentum thickness between 1500 and 11400, including flows with adverse and favorable pressure gradients which were produced by a National Advisory Committee for Aeronautics (NACA) 0012 airfoil installed above the flat plate. The present model follows the principle of the Corcos correction and is expressed with a simple mathematical form. Major improvements compared to the Corcos correction are made with regard to determining the effective sensing area and the convection velocity for a specific sensor. With the help of convection velocity modeling, the present correction model can be applied to flows in pressure gradients with high accuracy. To assess the generality of the assumptions, the model is used to correct the wall pressure spectra measured at different test facilities with different sensor types, covering a large range of Reynolds numbers, $1.6{}\times{}10^3<Re_\theta<1.19{}\times{}10^5$.