This paper analyses the effects of commodity price shocks in a new Keynesian model. The focus is on the central bank's choice of inflation target and the degree of real wage rigidity. It turns out that using core inflation rather than headline inflation is the superior strategy. Targeting expected headline inflation, as practiced by most central banks, is a viable practical alternative to the core inflation target. Simulations illustrate these points. The introduction of real wage rigidity into the model does not change these conclusions. Real wage rigidity does, however, imply second-round effects, making the monetary policy response, the inflation peak and the output drop more pronounced. Although in practice many of the assumptions of the model, such as full information, do not hold, lessons can be drawn for monetary policy. In case of a commodity supply shock, central banks would do well to focus on some measure of core inflation rather than headline inflation so as to reduce the volatility of both inflation and output. A communication strategy that places greater emphasis on underlying and expected inflation could serve to anchor inflation expectations.