Exhibit 23.1
CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We hereby consent to the incorporation by reference in the Registration Statements on Form S-3 (No. 333-193011) and Form S-8 (No. 333-208053 and
333-283124) of Community Trust Bancorp, Inc. (the Company) of our report dated February 27, 2026, relating to the consolidated financial statements, and the effectiveness of the Company’s internal control over financial reporting, which appear
in this Annual Report on Form 10-K.