ABSTRACT White dwarfs that have accreted planetary materials provide a powerful tool to probe the interiors and formation of exoplanets. In particular, the high Fe/Si ratio of some white dwarf pollutants suggests that they are fragments of bodies that were heated enough to undergo large-scale melting and iron core formation. In the Solar system, this phenomenon is associated with bodies that formed early and so had short-lived radionuclides to power their melting, and/or grew large. However, if the planetary bodies accreted by white dwarfs formed during the (pre)-main sequence lifetime of the host star, they will have potentially been exposed to a second era of heating during the star’s giant branches. This work aims to quantify the effect of stellar irradiation during the giant branches on planetary bodies by coupling stellar evolution to thermal and orbital evolution of planetesimals. We find that large-scale melting, sufficient to form an iron core, can be induced by stellar irradiation, but only in close-in small bodies: planetesimals with radii ≲ 30 km originally within ∼2 au orbiting a 1–3 M⊙ host star with solar metallicity. Most of the observed white dwarf pollutants are too massive to be explained by the accretion of these small planetesimals that are melted during the giant branches. Therefore, we conclude that those white dwarfs that have accreted large masses of materials with enhanced or reduced Fe/Si remain an indicator of planetesimal’s differentiation shortly after formation, potentially linked to radiogenic heating.