Trans-4-hydroxy-2-hexenal (4-HHE) and trans-4-hydroxy-2-nonenal (4-HNE) are secondary lipid peroxidation products in edible oils, which are cytotoxic and genotoxic. They could covalently bind with protein, phospholipids and DNA, further disrupting the normal function of liver, lung and brain. Derivation process was generally conducted during pretreatment before detection and quantification of 4-HHE and 4-HNE. However, the derivation procedures were time consuming and chemical degradation may occur during the process. Hence, this paper aims to establish a simple solid phase extraction-high performance liquid chromatography (SPE-HPLC) method to determine the 4-HHE and 4-HNE contents in thermally treated soybean oil. C18 solid phase extraction was applied in the pretreatment process. Firstly, the reliability of the method was evaluated. Good linearity was observed in the range of 0.1–0.5 μg/mL and 0.5–10 μg/mL for 4-HHE and 4-HNE. The limit of detection (LOD) of 4-HHE and 4-HNE were 0.0486 and 0.0129 μg/mL, respectively. And the limit of quantitation (LOQ) of 4-HHE and 4-HNE were 0.1458 and 0.0431 μg/mL, respectively. Recovery rate were in the range of 89.11%–91.58% and 71.83%–79.40% for 4-HHE and 4-HNE, respectively. The method achieved the extraction, purification and detection of 4-HHE and 4-HNE simultaneously and had the advantages of simple operation, effectiveness, high precision, good repeatability. Then, the method was applied to monitor the concentrations of 4-HHE and 4-HNE in soybean oil heated at 180 °C for 40 h. The contents of 4-HHE and 4-HNE were 0–0.32 μg/g and 0–6.97 μg/g, respectively, which provided guidance for evaluating health risks of thermally treated soybean oil during heating.