The evolution of cooperation is difficult to understand, because cheaters — individuals who profit without cooperating themselves — have a benefit in interaction with cooperators. Cooperation among humans is even more difficult to understand, because cooperation occurs in large groups, making cheating a bigger threat. Restricting cooperation to members of one’s own group based on some tag-based recognition of non-group members (allorecognition) has been shown to stabilise cooperation. We address how spatial structure and group size affect the opportunities for cheating such tag-based cooperation in a spatially explicit simulation. We show that increased group diversity, under conditions of limited dispersal, reduces the selective opportunities for cheaters. A small number can already be sufficient to keep cheating at a low frequency. We discuss how marginal additional benefits of increased group size, above the benefits of local cooperation, can provide the selective pressure to reduce the number of group identities and discuss possible examples.