The effects of impurity ions on the short wavelength ion temperature gradient (SWITG) driven instability in elongated tokamak plasmas are numerically investigated with the gyrokinetic integral eigenmode equation. It is found that for a moderate electron density gradient, the SWITG mode is first destabilized and then stabilized with increasing elongation j, which is different from the conventional long wavelength ITG mode. For a large electron density gradient, the elongation can effectively stabilize the SWITG mode. Moreover, the low Z impurity ions with inwardly (outwardly) peaked density profiles have stabilizing (destabilizing) effects on the SWITG modes in elongated plasmas. Interestingly, the high Z tungsten impurity ions with inwardly peaked density profiles play a stronger stabilizing role in the SWITG modes than the low Z impurity ions (such as carbon and oxygen) do. In particular, the high Z tungsten impurity ions with a weakly outwardly peaked density profile still have a stabilizing effect. Finally, the critical threshold of impurity density gradient scale length for exciting impurity mode is also numerically obtained, indicating that the impurity mode is harder to be excited in elongated plasmas than in circular ones. V C 2015 AIP Publishing LLC. [http://dx.