China strengthened environmental regulation to inhibit the formation of new pollution havens and to change its growth mode. This study explores the efficiency for attracting foreign direct investment (FDI) with the inclusion of environmental regulation in 31 Chinese provinces over the period 2015–2017, using a dynamic direction distance function‐data envelopment analysis (DDF‐DEA) model. The empirical results show that the mean overall efficiencies and ranks in the eastern region are significantly higher than those in the non‐eastern regions with or without environmental regulation, but the environmental regulation has a greater impact on the efficiency of attracting FDI in the economically developed areas. The average efficiencies for both the number of foreign companies and FDI amount in the eastern regions are higher than those in the non‐eastern regions. The industrial pollution control expenditure efficiency with the inclusion of environmental regulation of each province keeps in efficiency frontier. Relative to the efficiency of input variables, the output efficiencies in the non‐eastern regions have more scope to improve.