Preterm birth and enteral feeding are two main factors leading to necrotizing enterocolitis (NEC). The metabolomics of preterm infants before and after feeding can provide a basis for the prediction of NEC. Using the method of cross‐sectional study, the mode was established with the serum samples of 19 premature infants at birth and after feeding as the control group. The serum was analyzed using GC–MS. Chemometric analysis includes principal component analysis, partial least squares‐discriminant analysis, and orthogonal partial least squares‐discriminant analysis. Spectral separation of serum metabolites occurred in premature infants before and after feeding. The levels of xylose, d‐talose, phosphoglycolic acid, maleimide, l‐gulonolactone, maleic acid, β‐hydroxypyruvate, itaconic acid, and pantothenic acid in the serum of premature infants after feeding were significant in both multidimensional and single‐dimensional modes (variable importance in projection >2, P < 0.01). There was a moderate correlation between total bilirubin and l‐gulonolactone and β‐hydroxypyruvate (0.8 > r > 0.5). Maleimide, maleic acid, and itaconic acid have diagnostic value (area under the curve >0.9). The results indicated that serum metabolism of preterm infants changes significantly after feeding. Some metabolites have potential value in predicting NEC.