Metasurfaces have proven themselves an exotic ability to harness light at nano-scale, being important not only for classical but also for quantum optics. Dynamic manipulation of the quantum states is at the heart of quantum information processing;however, such function has been rarely realized with metasurfaces so far. Here, we report an all-optical dynamic modulation of the photonic quantum states using the nonlinear metasurface. The metasurface consists of a metallic nanostructure combined with a photoisomerizable azo layer. By tuning the plasmonic resonance through optically switching the azo molecules between their binary isomeric states, we have realized dynamic control of transmission efficiencies of orthogonally polarized photons and also the phase delay between them, thereby an entangled state was efficiently controlled. As an illustration, a quantum state distillation has been demonstrated to recover a Bell state from a non-maximally entangled one to that with fidelities higher than 98%. Our work would enrich the functions of the metasurface in the quantum world, from static to dynamic modulation, making the quantum metasurface going practical.