We investigated the relationship between diet specialization and geographical range in Cophixalus, a genus of microhylid frogs from the Wet Tropics of northern Queensland, Australia. The geographical ranges of these species vary from a few square kilometres in species restricted to a single mountain top to the entire region for the widespread species. Although macroecological theory predicts that species with broad niches should have the largest geographical ranges, we found the opposite: geographically rare species were diet generalists and widespread species were diet specialists. We argue that this pattern is a product of extinction filtering, whereby geographically rare and therefore extinction-prone species are more likely to persist if they are diet generalists.