Variability is a characteristic feature of young stellar objects (YSOs) and could contribute to the large scatter observed in Hertzsprung–Russell (HR) diagrams for star-forming regions. For typical YSOs, however, the long-term effects of variability are poorly constrained. Here we use archived near-infrared photometry from Two Micron All Sky Survey (2MASS), UKIDSS and DENIS to investigate the long-term variability of high-confidence members of the four star-forming regions ρ-Oph, ONC, IC348 and NGC 1333. The total sample comprises more than 600 objects, from which ∼ 320 are considered to have a disc. The data set covers time-scales up to 8 yr. About half of the YSOs are variable on a 2σ level, with median amplitudes of 5–20 per cent. The fraction of highly variable objects with amplitudes > 0.5 mag in at least two near-infrared bands is very low – 2 per cent for the entire sample and 3 per cent for objects with discs. These sources with strong variability are mostly objects with discs and are prime targets for follow-up studies. A transition disc candidate in IC348 is found to have strong K-band variations, likely originating in the disc. The variability amplitudes are largest in NGC 1333, presumably because it is the youngest sample of YSOs. The frequency of highly variable objects also increases with the time window of the observations (from weeks to years). These results have three implications. (1) When deriving luminosities for YSOs from near-infrared magnitudes, the typical error introduced by variability is in the range of 5–20 per cent and depends on disc fraction and possibly age. (2) Variability is a negligible contribution to the scatter in HR diagrams of star-forming regions (except for a small number of extreme objects), if luminosities are derived from near-infrared magnitudes. (3) Accretion outbursts with an increase in mass accretion rate by several orders of magnitudes, as required in scenarios for episodic accretion, occur with a duty cycle of >2000–2500 yr in the Class II phase.