We design optimal control strategies in spaces of diffeomorphisms and shape spaces in which the Eulerian velocities of the evolving deformations are constrained to belong to a suitably chosen finite-dimensional space, which is also following the motion. This results in a setting that provides a great flexibility in the definition of Riemannian metrics, extending previous approaches in which shape spaces are built as homogeneous spaces under the action of the diffeomorphism group equipped with a right-invariant metric. We provide specific instances of this general setting, and describe in detail the resulting numerical algorithms, with experimental illustrations in the case of plane curves.