Abstract Galaxy clusters are the most massive objects in the Universe and comprise a high-temperature intracluster medium of about 107 K, believed to offer a main foreground effect for cosmic microwave background (CMB) data in the form of the thermal Sunyaev–Zel’dovich (SZ) effect. This assumption has been confirmed by SZ signal detection in hundreds of clusters but, in comparison with the huge numbers of clusters within optically selected samples from Sloan Digital Sky Survey (SDSS) data, this only accounts for a few per cent of clusters. Here we introduce a model-independent new method to confirm the assumption that most galaxy clusters can offer the thermal SZ signal as their main foreground effect. For the Wilkinson Microwave Anisotropy Probe (WMAP) seven-year data (and a given galaxy cluster sample), we introduced a parameter d1 as the nearest-neighbour cluster angular distance of each pixel, then we classified data pixels as ‘to be’ (d1 → 0 case) or ‘not to be’ (d1 large enough) affected by the sample clusters. By comparing the statistical results of these two kinds of pixels, we can see how the sample clusters affect the CMB data directly. We find that the Planck Early Sunyaev–Zel’dovich (ESZ) sample and X-ray samples (∼102 clusters) can lead to obvious temperature depression in the WMAP seven-year data, which confirms the SZ effect prediction. However, each optically selected sample (>104 clusters) shows an opposite result: the mean temperature rises to about 10 μK. This unexpected qualitative scenario implies that the main foreground effect of most clusters is not always the expected SZ effect. This may be the reason why the SZ signal detection result is lower than expected from the model.