Vaccination programmes to prevent outbreaks after introductions of infectious people aim to maintain the average number of secondary infections per infectious person at one or less. We aimed to assess heterogeneity in vaccine uptake and other characteristics that, together with non-random mixing, could increase this number and to evaluate strategies that could mitigate their impact. Because most US children attend elementary school in their own neighbourhoods, surveys of children entering elementary school (age 5 years before Sept 1) allow assessment of spatial heterogeneity in the proportion of children immune to vaccine-preventable diseases. We used data from a 2008 school-entry survey by the Immunization Division of the California Department of Public Health to obtain school addresses; numbers of students enrolled; proportions of enrolled students who had received one or two doses of the measles, mumps, and rubella (MMR) vaccine; and proportions with medical or personal-belief exemptions. Using a mixing model suitable for spatially-stratified populations, we projected the expected numbers of secondary infections per infectious person for measles, mumps, and rubella. We also mapped contributions to this number for measles in San Diego County's 638 elementary schools and its largest district, comprising 200 schools (31%). We then modelled the effect on measles' realised reproduction number (RV) of the following plausible interventions: vaccinating all children with personal-belief exemptions, increasing uptake by 10% to 50% in all low-immunity schools (<90% of students immune) or in only influential (effective daily contact rates >3 or contacts inter-school >30%) low-immunity schools, and increasing private school uptake to the public school average. In 2008, 39 132 children began elementary school in San Diego County, CA, USA. At entry to school, 97% had received at least one dose of the MMR vaccine, with 2·5% having personal-belief exemptions. We note substantial heterogeneity in immunity throughout the county. Although the average population immunities for measles, mumps, and rubella (92%, 87%, 92%) were similar to the population-immunity thresholds in homogeneous, randomly-mixing populations (91%, 88%, 76%), after accounting for heterogeneity and non-random mixing, the basic reproduction numbers increased by 70%, meaning that introduced pathogens could cause outbreaks. The impact of our modelled interventions ranged from negligible to a nearly complete reduction in the outbreak potential of measles. The most effective intervention to lower the realised reproduction number (RV 3·39) was raising immunity by 50% in 114 schools with low immunity (RV 1·02), but raising immunity by this level in only influential, low-immunity schools also was effective (RV 2·02). The effectiveness of vaccinating the 972 children with personal-belief exemptions was similar to that of targeting all low-immunity schools (RV 1·11). Targeting only private schools had little effect. Our findings suggest that increasing vaccine uptake could prevent outbreaks such as that of measles in San Diego in 2008. Vaccinating children with personal-belief exemptions was one of the most effective interventions that we modelled, but further research on mixing in heterogeneous populations is needed. None.