Ribosomal proteins (RPs) are essential for genetic transcription and translation, playing a key role in plant growth, development, and stress responses, including disease resistance. However, the function and transcriptional regulation of RPL12 remain poorly understood. Investigating the gene function and the transcription factors that govern its expression is crucial to understanding its mechanism. In this study, a novel transcription factor gene, PpWRKY31, was isolated from Pyrus pyrifolia. The PpWRKY31 protein is expressed in the nucleus and belongs to Group IIb WRKY transcription factors. qRT-PCR analysis revealed that its expression was upregulated under the treatment of Alternaria alternata, as well as to exogenous hormonal treatments. Using yeast one-hybrid (Y1H) assay, dual-luciferase eporter assay, and electrophoretic mobility shift assay (EMSA), we demonstrated that PpWRKY31 can bind to the W-box element in the promoter region of PpRPL12. Overexpression of either PpWRKY31 or PpRPL12 enhanced the resistance of both pear and Arabidopsis thaliana plants to black spot disease, evidenced by reduced lesion size and increased activity of defense enzyme. Conversely, silencing of PpWRKY31 or PpRPL12 markedly diminished the resistance of pear to black spot disease. PpWRKY31 overexpression was observed to notably enhance the expression of PpRPL12 and genes associated with salicylic acid, inducing changes in the activity of enzymes related to the phenylpropanoid pathway, such as phenylalanine ammonia-lyase (PAL). In conclusion, this study elucidates a novel PpWRKY31-PpRPL12 signaling pathway that enhances resistance to pear black spot disease, providing insights into the regulatory networks underpinning plant defense responses. CORE: Pear black spot disease, caused by Alternaria alternata, seriously affects fruit quality and yield. We identified that PpWRKY31 transgenic calli responded to Alternaria alternata in pear. PpWRKY31 binds to the W-box cis-element of the PpRPL12 promoter, upregulating the expression of PpRPL12. The PpWRKY31-PpRPL12 regulatory module indirectly influences the downstream salicylic acid and phenylpropanoid pathways, ultimately enhancing the pear's black spot resistance. GENE AND ACCESSION NUMBERS: The sequence information used in this study is available in the Pear Genome Database (http://peargenome.njau.edu.cn/), the National Center for Biotechnology Information (NCBI) database, and The Arabidopsis Information Resource, see Table S2.