The anomalies of W3 gravity are calculated and analysed. There are conventional anomalies depending only on the gauge fields that are proportional to the central charges of the algebra and which cancel against ghost contributions in the critical dimension. In addition, there are anomalies that depend on the matter fields of the theory, some of which are non-trivial and cannot be cancelled. Thus quantum W3 gravity with gauge fields of spins two and three is anomalous, but a theory in which all matter-dependent anomalies can be cancelled is obtained by adding an infinite number of extra gauge fields. Matter-dependent anomalies occur generally for non-linearly realised symmetries and correspond to quantum modifications of the classical current algebra. For models in which the quantum current algebra closes, such anomalies can be cancelled by modifying the transformations of the fields. If the quantum current algebra does not close (as for W3), then there are matter-dependent anomalies that cannot be cancelled.