Exogenous NaHS treatment reduced the cognitive impairment of rats after SAH by ameliorating neuroinflammation in microglia, potentially via the TLR4/NF‐κB pathway. Here, NFKB1 is linked to Cognitive impairment.