We investigate the use of optimized correlation consistent gaussian basis sets for the study of insulating solids with auxiliary-field quantum Monte Carlo (AFQMC). The exponents of the basis set are optimized through the minimization of the second order M{o}ller--Plesset perturbation theory (MP2) energy in a small unit cell of the solid. We compare against other alternative basis sets proposed in the literature, namely calculations in the Kohn--Sham basis and in the natural orbitals of an MP2 calculation. We find that our optimized basis sets accelerate the convergence of the AFQMC correlation energy compared to a Kohn--Sham basis, and offer similar convergence to MP2 natural orbitals at a fraction of the cost needed to generate them. We also suggest the use of an improved, method independent, MP2-based basis set correction that significantly reduces the required basis set sizes needed to converge the correlation energy. With these developments, we study the relative performance of these basis sets in LiH, Si and MgO, and determine that our optimized basis sets yield the most consistent results as a function of volume. Using these optimized basis sets, we systematically converge the AFQMC calculations to the complete basis set and thermodynamic limit and find excellent agreement with experiment for systems studied. Although we focus on AFQMC, our basis set generation procedure is independent of the subsequent correlated wavefunction method used.