A semigroup is said to have the ideal retraction property when each of its ideals is a homomorphic retraction of the whole semigroup. This paper presents a complete characterization of the commutative semigroups that enjoy this property. The fundamental building blocks of these semigroups are the 2-cores and the semilattice of idempotents. Structure for semilattices with the ideal retraction property was discussed in an earlier paper and the structure of the 2-core is described in detail within this paper.