Localization is one of the essential problems in internet of things (IoT) and wireless sensor network (WSN) applications. However, most traditional range-free localization algorithms cannot fulfill the practical demand for high localization accuracy. Therefore, a localization algorithm based on an enhanced flower pollination algorithm (FPA) with Gaussian perturbation (EFPA-G) and the DV-Hop method is proposed.FPA is widely applied, but premature convergence still cannot be avoided. How to balance its global exploration and local exploitation capabilities still remains an outstanding problem. Therefore, the following improvement schemes are introduced. A search strategy based on Gaussian perturbation is proposed to solve the imbalance between the global exploration and local exploitation search capabilities. Meanwhile, to fully exploit the variability of population information, an enhanced strategy is proposed based on optimal individual and Lévy flight. Finally, in the experiments with 26 benchmark functions and WSN simulations, the former verifies that the proposed algorithm outperforms other state-of-the-art algorithms in terms of convergence and search capability. In the simulation experiment, the best value for the normalized mean squared error obtained by the most advanced algorithm, RACS, is 20.2650%, and the best value for the mean distance error is 5.07E+00. However, EFPA-G reached 19.5182% and 4.88E+00, respectively. It is superior to existing algorithms in terms of positioning, accuracy, and robustness.