The present invention relates to pyrazolecarboxanilides I in which the variables are as defined below: n is zero or 2; m is 2 or 3; X1 is fluorine or chlorine; X2 is halogen; Y is CN, NO2, C1-C4-alkyl, C1-C4-haloalkyl, methoxy or methylthio; p is zero or 1; R1 is fluorine, chlorine, bromine, C1-C4-alkyl or C1-C4-haloalkyl; R2 is hydrogen or halogen; R3 is hydrogen, methyl or ethyl; W is O or S; with the proviso that, if a) W=O, R1=methyl and R3 is hydrogen, R2 is not fluorine, or b) W=O, n=0, m=2, p=0, R2 and R3 are hydrogen, R1 is not trifluoromethyl or difluoromethyl, to processes for preparing these compounds, to compositions comprising them and to methods for using them for controlling harmful fungi.