In this paper, we show that the elliptic cocenter of the Hecke algebra of a connected reductive p-adic group is contained in the rigid cocenter. As applications, we prove the trace Paley–Wiener theorem and the abstract Selberg principle for mod-l representations.