Peanut (Arachis hypogea L.) yield is dramatically declined by extreme weather stresses under climate change. Adjusting the sowing date and plant density are effective strategies to mitigate these stresses and improve peanut yield. However, a mechanistic understanding of the influence of environmental drivers and an optimized strategy have yet to be developed. Here, a 3‐year field experiment was conducted to evaluate the sowing date (April 25, early sowing; May 5, middle sowing; May 15, late sowing) and plant density (24, 30, and 36 plants m−2 as low, medium, and high) of peanut in the North China Plain. We found that higher pod yield was observed in the middle sowing (∼4492.4 kg ha−1) compared with the early and late sowing (∼3317.2 and 4088.1 kg ha−1, respectively). Meanwhile, the pod yield in high density (∼4162.5 kg ha−1) was 10.6% and 4.7% higher than low and medium density, respectively, mainly due to higher leaf area index. The relative peanut pod yield was positively correlated with the average minimum temperature 5 days before and after the flowering pegging stage, whilst it was negatively correlated with average maximum temperature 5 days before and after pod filling stage. Therefore, optimizing temperature conditions to improve the peanut yield can be achieved by adjusting the sowing date. In conclusion, sowing date and plant density manipulation constitute a useful method to mitigate heat and chilling stress and improve peanut yield.