We study the effectiveness of a community-level information and mobilization intervention to reduce open defecation (OD) and increase sanitation investments in Nigeria. The results of a cluster-randomized control trial in 246 communities, conducted between 2014 and 2018, suggest that average impacts are exiguous. However, these results hide important community heterogeneity, as the intervention has strong and lasting effects on OD habits in poorer communities. This result is robust across several measures of community socio-economic characteristics, and is not driven by baseline differences in toilet coverage. In poor communities, OD rates decreased by 9pp from a baseline level of 75%, while we find no effect in richer communities. The reduction in OD is achieved mainly through increased toilet ownership (+8pp from a baseline level of 24%). In terms of channels, the intervention appears to have raised the social status attached to toilet ownership among the poorer treated communities, and not in rich communities. Finally, we use data from our study and five other trials of similar interventions and show that estimated impacts on OD are stronger in poorer contexts, rationalizing the wide range of estimates in the literature and providing plausible external validity.