The elephant herding optimization (EHO) algorithm is a novel metaheuristic optimizer inspired by the clan renewal and separation behaviors of elephant populations. Although it has few parameters and is easy to implement, it suffers from a lack of exploitation, leading to slow convergence. This paper proposes an improved EHO algorithm called manta ray foraging and Gaussian mutation-based EHO for global optimization (MGEHO). The clan updating operator in the original EHO algorithm is replaced by the somersault foraging strategy of manta rays, which aims to optimally adjust patriarch positions. Additionally, a dynamic convergence factor is set to balance exploration and exploitation. The gaussian mutation is adopted to enhance the population diversity, enabling MGEHO to maintain a strong local search capability. To evaluate the performances of different algorithms, 33 classical benchmark functions are chosen to verify the superiority of MGEHO. Also, the enhanced paradigm is compared with other advanced metaheuristic algorithms on 32 benchmark functions from IEEE CEC2014 and CEC2017. Furthermore, a scalability test, convergence analysis, statistical analysis, diversity analysis, and running time analysis demonstrate the effectiveness of MGEHO from various aspects. The results illustrate that MGEHO is superior to other algorithms in terms of solution accuracy and stability. Finally, MGEHO is applied to solve three real engineering problems. The comparison results show that this method is a powerful auxiliary tool for handling complex problems.