Electronic coherences resulting from molecular photoionization underlie the process of attosecond charge migration, widely investigated as a possible path towards controlled charge-directed reactivity1–4. However, photoionization often creates entangled ions and photoelectrons. This entanglement compromises the ability to explore coherent ultrafast electron dynamics within ions or of their accompanying photoelectrons5–8. Here we present experiments and calculations in which hydrogen molecules are ionized by the combination of a phase-locked pair of isolated attosecond laser pulses and a few-cycle near-infrared (NIR) laser pulse. The electronic coherence in the dissociating H2+ ion is influenced by ion–photoelectron entanglement. We demonstrate experimental control over the degree of entanglement by varying the delay between the two attosecond pulses and the delay between these pulses and the few-cycle NIR pulse. Our work demonstrates the importance of proper consideration of the role of quantum entanglement for the optimal observation of electronic coherences in attosecond experiments. Dissociative ionization of H2 molecules by the combination of a phase-locked attosecond laser pair and a few-cycle NIR laser shows that ion–photoelectron entanglement influences electronic coherence in H2+, allowing control over the degree of entanglement by varying the delay between the pulses. Attosecond pulses produced by high-harmonic generation (HHG) consisting of extreme-ultraviolet (XUV) radiation can ionize any conceivable compound, leading to the formation of a bipartite ion–photoelectron system that is entangled whenever the total ... [39193 chars]