Taking the data of 30 provinces, regions and cities in China from 2002 to 2016 as the research sample, based on SBM directional distance function Malmquist-Luenberger index method to measure the green total factor productivity, this paper selects the fixed-effect model to empirically analyzes the impact of trade openness and FDI on green total factor productivity. The results show that trade opening is conducive to promoting technological progress, which in turn has a significant promoting effect on China’s green total factor productivity, while FDI has a significant inhibitory effect on China’s green total factor productivity, which verifies the hypothesis of “pollution sanctuary”. And there is regional heterogeneity in this effect, namely, trade opening has a more significant promoting effect on green total factor productivity in eastern coastal areas, while FDI has a more obvious inhibiting effect on green total factor productivity in central and western inland areas. The interaction between trade opening and FDI is conducive to the improvement of green total factor productivity, which indicates that the positive mechanism of trade opening and FDI has been formed. The input of science and technology, the level of material capital and the level of human capital are all conducive to the improvement of green total factor productivity, but there are problems of resource waste and environmental pollution in infrastructure construction, which have an inhibitory effect on green total factor productivity.