Integrating machine learning techniques into medical diagnostic systems holds great promise for enhancing disease identification and treatment. Among the various options for training such systems, the extreme learning machine (ELM) stands out due to its rapid learning capability and computational efficiency. However, the random selection of input weights and hidden neuron biases in the ELM can lead to suboptimal performance. To address this issue, our study introduces a novel approach called modified Harris hawks optimizer (MHHO) to optimize these parameters in ELM for medical classification tasks. By applying the MHHO-based method to seven medical datasets, our experimental results demonstrate its superiority over seven other evolutionary-based ELM trainer models. The findings strongly suggest that the MHHO approach can serve as a valuable tool for enhancing the performance of ELM in medical diagnosis.