Bariatric surgery (BS) is an effective treatment for obesity. Adipose tissue, liver tissue and skeletal muscle are important metabolic tissues. This study investigated hub genes and their association with immune infiltration in these metabolic tissues of obese patients after BS by bioinformatic analysis with Gene Expression Omnibus datasets. Differentially expressed genes (DEGs) were identified, and a protein–protein interaction network was constructed to identify hub genes. As a result, 121 common DEGs were identified and mainly enriched in cytokine–cytokine receptor interactions, chemokine signaling pathway, neutrophil activation and immune responses. Immune cell infiltration analysis showed that the abundance of M1 macrophages was significantly lower in adipose and liver tissue after BS (p<0.05). Ten hub genes (TYROBP, TLR8, FGR, NCF2, HCK, CCL2, LAPTM5, MNDA and S100A9) that were all downregulated after BS were also associated with immune cells. Consistently, results in the validated dataset showed that the expression levels of these hub genes were increased in obese patients and mice, and decreased after BS. In conclusion, this study analysed the potential immune and inflammatory mechanisms of BS in three key metabolic tissues of obese patients, and revealed hub genes associated with immune cell infiltration, thus providing potential targets for obesity treatment.