In this study, Xylosma racemosum was selected as the raw material and its compressive strength was predicted through nondestructive methods. The test data consisted of 160 near-infrared (NIR) absorption spectra of the wood samples obtained using an NIR spectrometer, with the wavelength range of 900 to 1900 nm. The original absorption spectra were pre-processed with multiplicative scatter correction (MSC) and Savitzky-Golay (SG) smoothing and divided into several intervals using the backward interval partial least squares (BiPLS) method. The optimal combination of intervals with the smallest root mean square error of cross validation (RMSECV) value was selected, and a genetic algorithm (GA) was used to select featured wavelengths. Finally, a partial least squares (PLS) regression model was established with the featured wavelengths. The BiPLS-GA-PLS model outperformed the other models, resulting in a high prediction correlation coefficient of 0.927 and a root mean square error rate of 4.06. Based on the results, it is feasible to accurately measure the compressive strength of wood processed by different methods using near-infrared spectroscopy.