Abstract On 6 February 2023, a magnitude 7.8 earthquake struck south-central Türkiye. It was followed by many aftershocks, the largest of which was a magnitude 7.5 aftershock. This earthquake caused considerable loss of life and property. Numerous near-fault ground-motion records were collected during the 2023 Türkiye earthquake. Most existing baseline correction methods for near-fault ground motions disregard the commonly used filtering techniques due to their potential elimination of actual permanent displacement. To address this, a new automatic baseline correction method is proposed based on the continuous wavelet transform, which incorporates filtering while preserving permanent displacement. This method is compatible with existing filtering techniques and demonstrates good applicability. In this approach, the raw record is decomposed into a pulse signal containing permanent displacement and a nonpulse signal. The nonpulse signal is high-pass filtered to obtain the corrected nonpulse signal, and then the true ground motion is obtained by combining the pulse signal with the corrected nonpulse signal. The effectiveness of the proposed method is evaluated across five aspects using the 1999 Chi-Chi earthquake records: time histories, baseline offsets, response spectra, peak ground velocities, and peak ground displacements. Furthermore, the method is applied to 36 station records (108 components) of the 2023 Türkiye earthquake. The analysis results indicate that the corrected displacement time histories exhibit sustained flatness in their tails and demonstrate a closer agreement with the Global Navigation Satellite System (GNSS) measurements than the previous methods. This method can also incorporate static GNSS offsets to accurately determine true ground motions with precise permanent displacements. The corrected results can be utilized for nonlinear seismic calculations and structural damage analysis of fault-crossing structures such as bridges and tunnels.