ABSTRACT Nowadays, it becomes imperative to develop polyimide (PI) aerogels with excellent thermal insulation and mechanical performance to suit the demanding needs in high‐tech sectors such as aerospace, electronics and fire protection among others. Herein, a series of PI aerogels with different dianhydride structures were prepared by sol–gel method, with 2,2′‐dimethylbenzidine (DMBZ) being used as the diamine. The microstructure, mechanical properties, thermal stability, and thermal insulation properties of PI aerogels were regulated by changing the dianhydride structure. The compressive strength of PI aerogels at 10% strain was in the range of 0.04–1.60 MPa, and PI PMDA‐DMBZ aerogel exhibited the best compressive strength among the studied systems. In addition, PI BPDA‐DMBZ aerogel had an initial degradation temperature up to 510°C and thermal conductivity as low as 0.032 W/(m⋅K), demonstrating excellent thermal stability and insulation properties that can withstand harsh conditions.