Gentiana macrophylla is one of Chinese herbal medicines in which 4 kinds of iridoids or secoiridoids, such as loganic acid, sweroside, swertiamarin, and gentiopicroside, are identified as the dominant medicinal secondary metabolites. WRKY, as a large family of transcription factors (TFs), plays an important role in the synthesis of secondary metabolites in plants. Therefore, WRKY genes involved in the biosynthesis of secoiridoids in G. macrophylla were systematically studied. First, a comprehensive genome-wide analysis was performed, and 42 GmWRKY genes were identified, which were unevenly distributed in 12 chromosomes. Accordingly, gene structure, collinearity, sequence alignment, phylogenetic, conserved motif and promoter analyses were performed, and the GmWRKY proteins were divided into three subfamilies based on phylogenetic and multiple sequence alignment analyses. Moreover, the enzyme-encoding genes of the secoiridoid biosynthesis pathway and their promoters were then analysed, and the contents of the four secoiridoids were determined in different tissues. Accordingly, correlation analysis was performed using Pearson′s correlation coefficient to construct WRKY gene-enzyme-encoding genes and WRKY gene–metabolite networks. Meanwhile, G. macrophylla seedlings were treated with methyl jasmonate (MeJA) to detect the dynamic change trend of GmWRKYs, biosynthetic genes, and medicinal ingredient accumulation. Thus, a total of 12 GmWRKYs were identified to be involved in the biosynthesis of secoiridoids, of which 8 (GmWRKY1, 6, 12, 17, 33, 34, 38 and 39) were found to regulate the synthesis of gentiopicroside, and 4 (GmWRKY7, 14, 26 and 41) were found to regulate the synthesis of loganic acid. Taken together, this study systematically identified WRKY transcription factors related to the biosynthesis of secoiridoids in G. macrophylla, which could be used as a cue for further investigation of WRKY gene functions in secondary metabolite accumulation.