In models with complete markets, targeting core inflation enables monetary policy to maximize welfare by replicating the flexible price equilibrium. We develop a two-sector two-good new-Keynesian model to study the optimal choice of price index in markets with financial frictions. We find that, in the presence of financial frictions, a welfare-maximizing central bank should adopt flexible headline inflation targeting a target for headline CPI inflation with some weight on the output gap. These results are particularly relevant for emerging markets, where the share of food expenditures in total consumption expenditures is high and a large proportion of consumers are credit constrained.