We investigate the importance of the shielding of chemical photorates by molecular hydrogen photodissociation lines and the carbon photoionization continuum deep within models of photon-dominated regions (PDRs). In particular, the photodissociation of N2 and CN is significantly shielded by the H2 photodissociation line spectrum. We model this by switching off the photodissociation channels for these species behind the H i→H2 transition. We also model the shielding effect of the carbon photoionization continuum as an attenuation of the incident radiation field shortwards of 1102 Å. Using recent line and continuum cross-section data, we present calculations of the direct and cosmic-ray-induced photorates for a range of species, as well as optically thick shielding factors for the carbon continuum. Applying these to a time-dependent PDR model we see enrichments in the abundances of N2, N2H+, NH3 and CN by factors of ∼3–100 in the extinction band Av = 2.0–4.0 for a range of environments. While the precise quantitative results of this study are limited by the simplicity of our model, they highlight the importance of these mutual shielding effects, neither of which has been discussed in recent models.