Abstract A matched filter technique is applied to the Planck all-sky Compton y-parameter map to measure the thermal Sunyaev–Zel’dovich (tSZ) effect produced by galaxy groups of different halo masses selected from large redshift surveys in the low-z universe. Reliable halo mass estimates are available for all of the groups, which allows us to bin groups of similar halo masses to investigate how the tSZ effect depends on halo mass over a large mass range. Filters are simultaneously matched for all groups to minimize projection effects. We find that the integrated y-parameter and the hot gas content it implies are consistent with the predictions of the universal pressure profile model only for massive groups above , but much lower than the model prediction for low-mass groups. The halo mass dependence found is in good agreement with the predictions of a set of simulations that include strong active galactic nucleus feedback, but simulations including only supernova feedback significantly overpredict the hot gas contents in galaxy groups. Our results suggest that hot gas in galaxy groups is either effectively ejected or in phases much below the virial temperatures of the host halos.