  In this paper we study arbitrary $W$ algebras related to embeddings of $sl_2$
in a Lie algebra $g$. We give a simple formula for all $W$ transformations,
which will enable us to construct the covariant action for general $W$ gravity.
It turns out that this covariant action is nothing but a Fourier transform of
the WZW action. The same general formula provides a geometrical interpretation
of $W$ transformations: they are just homotopy contractions of ordinary gauge
transformations. This is used to argue that the moduli space relevant to $W$
gravity is part of the moduli space of $G$-bundles over a Riemann surface.
