Metaheuristic algorithms are intelligent optimization approaches that lead the searching procedure through utilizing exploitation and exploration. The increasing complexity of real-world optimization problem has prompted the development of more metaheuristic algorithms. Hence, this work proposes a novel swarm intelligence algorithm, Walrus optimizer (WO). It is inspired by the behaviors of walruses that choose to migrate, breed, roost, feed, gather and escape by receiving key signals (danger signals and safety signals). To test the capability of the proposed algorithm, 23 standard functions and the benchmark suite from the IEEE (Institute of Electrical and Electronics Engineers) Congress on Evolutionary Computation (CEC) 2021 are used. In addition, to evaluate the practicability of the proposed algorithm to solve various real-world optimization problems, 6 standard classical engineering optimization problems are examined and compared. For statistical purposes, 100 independent optimization runs are conducted to determine the statistical measurements, including the mean, standard deviation, and the computation time of the program, by considering a predefined stopping criterion. Some well-known statistical analyses are also used for comparative purposes, including the Friedman and Wilcoxon analysis. The results demonstrate that the proposed algorithm can provide special stability features and very competitive performance in dealing with high-dimensional benchmarks and real-world problems. The proposal of WO promotes the continuous development and application expansion of artificial intelligence, improves the efficiency of optimization calculation, and provides powerful tools for solving complex problems in the real world. The source code of WO is publicly availabe at https://ww2.mathworks.cn/matlabcentral/fileexchange/154702-walrus-optimizer-wo.