Resveratrol, a stilbene phytoalexin in plants, is believed to benefit human health. In this study, an optimized enzyme‐assisted method was developed to extract the total content of trans‐resveratrol (free or combined with glucose) in peanut seeds, followed by detection using high‐performance liquid chromatography. The extraction process was optimized by Box–Behnken design and response surface methodology. The optimized enzyme concentration, digestion time, pH, and temperature were 3.02 g/L, 57.06 min, 5.88, and 51.05°C, respectively. Validation tests indicated that the experimental yield of trans‐resveratrol was 0.183 ± 0.007 µg/g with a relative standard deviation of 3.87% (n = 5) under the optimal condition, which was closely agreed with the predicted value (0.182 µg/g). The recoveries obtained from the spiked samples were varied from 89.4 to 103.9%. Therefore, this study will provide a useful method for quantification of total trans‐resveratrol in peanut seeds.