The time-integrated $CP$ asymmetry in the decay $D^0 to K^0_S K^0_S$ is measured using $3 fb^{-1}$ of proton-proton collision data collected by the LHCb experiment at centre-of-mass energies of 7 and 8 TeV. The flavour of the $D^0$ meson is determined by use of the decay $D^{*+} to D^0 pi^+$ and its charge conjugate mode. The result is [ {cal A}_{CP} = -0.029 pm 0.052 pm 0.022, ] where the first uncertainty is statistical and the second systematic. The result is consistent with Standard Model expectations and improves the uncertainty with respect to the only previous measurement of this quantity by more than a factor of three.