Both the porous medium equation and the system of isentropic Euler equations can be considered as steepest descents on suitable manifolds of probability measures in the framework of optimal transport theory. By discretizing these variational characterizations instead of the partial differential equations themselves, we obtain new schemes with remarkable stability properties. We show that they capture successfully the nonlinear features of the flows, such as shocks and rarefaction waves for the isentropic Euler equations. We also show how to design higher order methods for these problems in the optimal transport setting using backward differentiation formula (BDF) multi-step methods or diagonally implicit Runge-Kutta methods.