Wind power forecasting is pivotal in optimizing renewable energy generation and grid stability. This paper presents a groundbreaking optimization algorithm to enhance wind power forecasting through an improved al-Biruni Earth radius (BER) metaheuristic optimization algorithm. The BER algorithm, based on stochastic fractal search (SFS) principles, has been refined and optimized to achieve superior accuracy in wind power prediction. The proposed algorithm is denoted by BERSFS and is used in an ensemble model’s feature selection and optimization to boost prediction accuracy. In the experiments, the first scenario covers the proposed binary BERSFS algorithm’s feature selection capabilities for the dataset under test, while the second scenario demonstrates the algorithm’s regression capabilities. The BERSFS algorithm is investigated and compared to state-of-the-art algorithms of BER, SFS, particle swarm optimization, gray wolf optimizer, and whale optimization algorithm. The proposed optimizing ensemble BERSFS-based model is also compared to the basic models of long short-term memory, bidirectional long short-term memory, gated recurrent unit, and the k-nearest neighbor ensemble model. The statistical investigation utilized Wilcoxon’s rank-sum and analysis of variance tests to investigate the robustness of the created BERSFS-based model. The achieved results and analysis confirm the effectiveness and superiority of the proposed approach in wind power forecasting.