Carbon monoxide molecules in their electronic, vibrational, and rotational ground state are highly attractive for trapping experiments. The optical or ac electric traps that can be envisioned for these molecules will be very shallow, however, with depths in the sub-milliKelvin range. Here we outline that the required samples of translationally cold CO (X$^1Sigma^+$, $v$=0, $N$=0) molecules can be produced after Stark deceleration of a beam of laser-prepared metastable CO (a$^3Pi_1$) molecules followed by optical transfer of the metastable species to the ground state emph{via} perturbed levels in the A$^1Pi$ state. The optical transfer scheme is experimentally demonstrated and the radiative lifetimes and the electric dipole moments of the intermediate levels are determined.