To investigate the influence of hydrogen bonding on the properties of polyimides (PIs) containing rigid rod‐like groups, five symmetrical diamines containing benzimidazole, benzoxazole, and hydroxy group were synthesized, and then a series of PIs were prepared. Results showed that hydroxyl‐containing poly(benzoxazole imide)s possess higher glass transition temperature (Tg) and dimensional stabilities than their corresponding poly(benzoxazole imide)s. Moreover, the corresponding poly(benzimidazole imide)s presented the best performances, such as the highest Tg, the highest char yield and the highest dimensional stabilities. The influence of hydrogen bonding of benzimidazole on the properties of PIs was stronger than that of hydroxyl groups. Hydroxyl‐containing poly(benzoxazole imide)s were formed in crosslinking structures after heat treatment at 400 °C. © 2015 Wiley Periodicals, Inc. J. Polym. Sci., Part A: Polym. Chem. 2016, 54, 570–581