In perovskite solar cells, the conventional n–i–p structure employing spiro-MeOTAD as a p-type hole transport layer suffers from poor thermal stability. Now, a non-volatile solid-state additive, 4-(N-carbazolyl)pyridine, is introduced to improve the thermal stability of spiro-MeOTAD and enable solar cells to perform more reliably under harsh conditions.