Obesity-related cognitive dysfunction poses a significant threat to public health. The present study demonstrated mitigating effects of intermittent fasting (IF) and its combination with isomalto-oligosaccharides and IF (IF + IMO) on cognitive impairments induced by a high-fat-high-fructose (HFHF) diet in mice, with IF + IMO exhibiting superior effects. Transcriptomic analysis of the hippocampus revealed that the protective effects on cognition might be attributed to the suppression of toll-like receptor 4 (TLR4)/NFκB signaling, oxidative phosphorylation, and neuroinflammation. Moreover, both IF and IF + IMO modulated the gut microbiome and promoted the production of short-chain fatty acids, with IF + IMO displaying more pronounced effects. IF + IMO-modulated gut microbiota, metabolites, and molecular targets associated with cognitive impairments were further corroborated using human data from public databases Gmrepo and gutMgene. Furthermore, the fecal microbiome transplantation confirmed the direct impacts of IF + IMO-derived microbiota on improving cognition functions by suppressing TLR4/NFκB signaling and increasing BDNF levels. Notably, prior exposure to IF + IMO prevented weight-regain-induced cognitive decline, suppressed TLR4/NFκB signaling and inflammatory cytokines in the hippocampus, and mitigated weight regain-caused gut dysbacteriosis without altering body weight. Our study underscores that IMO-augmented alleviating effects of IF on obesity-related cognitive impairment particularly during weight-loss and weight-regain periods, presenting a novel nutritional strategy to tackle obesity-related neurodegenerative disorders.