This investigation aims to screen ischemic stroke (IS)-related hub genes of central post-stroke pain (CPSP) from public databases and predict their potential roles through bioinformatics analysis to better interpret CPSP in IS. First, based on differential analysis, Venn analysis, and enrichment analyses, we identified 13 differently expressed genes in CPSP (CPSP-DEGs) related to the TNF signaling pathway, Vascular smooth muscle contraction, and IL-17 signaling pathway. Subsequently, through screening and analysis of the PPI network constructed by the Search Tool for the Retrieval of Interacting Genes (STRING) database, we obtained 3 CPSP-related hub genes (CD163, MMP9, and ARG1). They were all highly expressed in the IS group, exhibiting good diagnostic performance, with area under curve (AUC) value > 0.85. The immune-related analysis demonstrated that the infiltration levels of various immune cells in the IS group and the normal group were substantially different. In addition, by utilizing some online websites, we not only predicted some microRNAs (miRNAs) and transcription factors (TFs) that may target hub genes but also mined small molecular drugs that may target differentially expressed genes (DEGs) in IS. In conclusion, this project first investigated the role of CPSP-related genes in IS and identified 3 hub genes. At the same time, we predicted some miRNAs, TFs, and candidate drugs that may target hub genes. Our research uncovered the potential mechanism of CPSP-related genes in IS from multiple perspectives. Furthermore, it also laid a research foundation for the future study of the mechanisms of IS disease.