Magnetars are highly magnetized rotating neutron stars that are predominantly observed as high-energy sources. Six of this class of neutron star are known to also emit radio emission, so magnetars are a favoured model for the origin of at least some of the fast radio bursts (FRBs). If magnetars, or neutron stars in general, are indeed responsible, sharp empirical constraints on the mechanism producing radio emission are required. Here we report on the detection of polarized quasi-periodic substructure in the emission of all well-studied radio-detected magnetars. A correlation previously seen, relating substructure in pulsed emission of radio-emitting neutron stars to their rotational period, is extended and now shown to span more than six orders of magnitude in pulse period. This behaviour is not only seen in magnetars but in members of all classes of radio-emitting rotating neutron stars, regardless of their evolutionary history, their power source or their inferred magnetic field strength. If magnetars are responsible for FRBs, it supports the idea of being able to infer underlying periods from sub-burst timescales in FRBs.