Aiming at the problem that the existing harmonic detection methods are susceptible to noise interference in the actual working environment, which leads to the reduction of detection accuracy, this paper introduces a novel harmonic detection technique utilizing a RIME optimization algorithm (RIME) to enhance variational mode decomposition (VMD) combined with an improved wavelet threshold (IWT) approach. Initially, RIME optimization refines VMD for the decomposition of harmonic current signals, yielding several modal components. Subsequently, a correlation coefficient method distinguishes between effective and ineffective modal components, discarding the latter. The effective components undergo noise reduction through an enhanced wavelet thresholding technique, and these denoised components are then reconstructed to produce the final noise-reduced signal. Finally, the Hilbert transform is applied to the denoised signal to extract harmonic parameters. Verification through both simulated and actual signal measurements demonstrates that the proposed method not only surpasses other noise reduction algorithms in signal-to-noise ratio and root-mean-square error, but also shows superior accuracy and robustness compared to alternative detection techniques. This method effectively filters out signal noise under noise interference, minimizes detection errors, and achieves precise harmonic signal detection with improved accuracy.