We present an efficient strategy for controlling a vast range of nonintegrable quantum many-body one-dimensional systems that can be merged with state-of-the-art tensor network simulation methods such as the density matrix renormalization group. To demonstrate its potential, we employ it to solve a major issue in current optical-lattice physics with ultracold atoms: we show how to reduce by about 2 orders of magnitude the time needed to bring a superfluid gas into a Mott insulator state, while suppressing defects by more than 1 order of magnitude as compared to current experiments [T. Stöferle et al., Phys. Rev. Lett. 92, 130403 (2004)]. Finally, we show that the optimal pulse is robust against atom number fluctuations.