Resonant cavities with high quality factor and small mode volume provide crucial enhancement of lightâˆ’matter interactions in nanophotonic devices that transport and process classical and quantum information. The production of functional circuits containing many such cavities remains a major challenge, as inevitable imperfections in the fabrication detune the cavities, which strongly affects functionality such as transmission. In photonic crystal waveguides, intrinsic disorder gives rise to high-Q localized resonances through Anderson localization; however their location and resonance frequencies are completely random, which hampers functionality. We present an adaptive holographic method to gain reversible control on these randomly localized modes by locally modifying the refractive index. We show that our method can dynamically form or break highly transmitting necklace states, which is an essential step toward photonic-crystal-based quantum networks and signal processing circuits, as well as slow light applications and fundamental physics.