In response to the problem of poor search performance and difficulty in escaping from the local optimum in the Harris hawks optimizer, an improved Harris hawks optimizer with enhanced logarithmic spiral and dynamic factor (IHHO‐ELSDF) is proposed in this paper. The enhanced logarithmic spiral mechanism is adopted in the exploration phase, and its main feature is the use of an improved opposite‐learning hybrid logarithmic spiral mechanism to search for more promising regions. The dynamic factor is used to replace the escaping energy to improve the global search capability of the algorithm, and it can better balance exploration and exploitation. In addition, a random distribution strategy is proposed for the exploitation phase to avoid falling into the local optimum. Based on 23 classical test functions, the influence of the distribution probability, the three improved mechanisms, and the exploration–exploitation ratio in IHHO‐ELSDF are analyzed. Subsequently, IHHO‐ELSDF is subjected to a comparative analysis with 17 algorithms on the IEEE CEC2022 benchmark suite. These tests show that IHHO‐ELSDF outperforms most competitors in numerical optimization. Furthermore, to assess its applicability in real‐world problems, IHHO‐ELSDF is employed to optimize parameters in the wavelet neural network used for molten iron temperature prediction. The simulation results based on real production data show that the proposed prediction model achieves a high prediction precision with , , and .