Within a density-functional context, the random-phase approximation ~RPA! for the correlation energy makes a short-range error that is well suited for correction by a local spin density or generalized-gradient approximation ~GGA!. Here we construct a GGA for the short-range correction, following the same reliable procedure used earlier to construct the GGA for the whole exchange-correlation energy: real-space cutoff of the spurious long-range contribution to the gradient expansion of the hole around an electron. The resulting density functional is nearly local and predicts a substantial correction to the RPA correlation energy of an atom but very small corrections to the RPA atomization energy of a molecule, which may by itself come close to ‘‘chemical accuracy’’ and to the RPA surface energy of a metal. A by-product of this work is a density functional for the system-averaged correlation hole within RPA.