High-dimensional datasets (HDDs) pose significant challenges in feature selection due to their complex nature. While metaheuristic algorithms like the Whale Optimisation Algorithm (WOA) have shown promise in addressing these challenges, stability issues are least addressed. Through an extensive literature review, it was identified that stability is manifested in the equilibrium of exploration and exploitation. Hence, this study introduced the Hierarchical Whale Optimisation Algorithm (HiWOA), an approach designed to enhance the WOA’s stability and performance in HDD feature selection tasks. The HiWOA incorporates a two-phase strategy comprising a nonlinear control parameter based on the arcsine function and a hierarchical position-update mechanism adapted from the Grey Wolf Optimiser. The proposed HiWOA was evaluated through 23 benchmark optimisation functions and feature selection experiments on 11 medical HDDs. The results indicate that the HiWOA outperformed the WOA and a modified variant (mWOA) in terms of a better fitness value, a more balanced exploration-exploitation ratio, and improved classification accuracy with fewer selected features. These findings demonstrate the HiWOA’s effectiveness in enhancing stability, making it a robust solution for high-dimensional optimisation and feature selection.