Salinization is recognized as a threat to soil fertility worldwide. A challenge in understanding the effects of salinity on soil microbial communities is the fact that it can be difficult to disentangle the effects of salinity from those of other variables that may co-vary with salinity. Here we use a trait-based approach to identify direct effects of salinity on soil bacterial communities across two salinity gradients. Through dose–response relationships between salinity and bacterial growth, we quantified distributions of the trait salt tolerance within the communities. Community salt tolerance was closely correlated with soil salinity, indicating a strong filtering effect of salinity on the bacterial communities. Accompanying the increases in salt tolerance were consistent shifts in bacterial community composition. We identified specific bacterial taxa that increased in relative abundances with community salt tolerance, which could be used as bioindicators for high community salt tolerance. A strong filtering effect was also observed for pH across the gradients, with pH tolerance of bacterial communities correlated to soil pH. We propose phenotypic trait distributions aggregated at the community level as a useful approach to study the role of environmental factors as filters of microbial community composition.